PDF: How do I implement a Last Page Footer different from other pages?

Post here questions and problems related to editing and publishing DITA content.
GregWait
Posts: 10
Joined: Thu Apr 21, 2016 8:49 pm

PDF: How do I implement a Last Page Footer different from other pages?

Post by GregWait »

How do I change the size of (1) the body region of the last page and (2) the footer height of the last page?
(I believe I know which values to change, but it does not appear that the plugin "knows" when to implement "last" page changes.)

I have a custom PDF plugin that puts some boilerplate copyright info at the bottom of the last page along with the company logo and address. Using absolute positioning I have everything I want showing up exactly as I want it at the bottom of the last page, BUT I am unable to manipulate the size of the footer or usable print area of the last page. This means my last page "footer" info can overflow the page content when th4e content fills the last page to the bottom.

From my testing, it appears that nothing I do is triggering the plugin to recognize when a last page footer should be applied.

Any help is appreciated!
Costin
Posts: 833
Joined: Mon Dec 05, 2011 6:04 pm

Re: PDF: How do I implement a Last Page Footer different from other pages?

Post by Costin »

Hi GregWait,

Could you please let us know what transformation scenario are you using?
Is it one of the scenarios that come predefined in oXygen? And if it is, which one specifically (DITA Map PDF / DITA Map PDF WYSIWYG / DITA Map PDF HTML 5 & CSS)?

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
GregWait
Posts: 10
Joined: Thu Apr 21, 2016 8:49 pm

Re: PDF: How do I implement a Last Page Footer different from other pages?

Post by GregWait »

Costin,

In my question, I specified that it is a CUSTOM PDF transformation. It is based on the standard PDF2 transform.

Greg
Costin
Posts: 833
Joined: Mon Dec 05, 2011 6:04 pm

Re: PDF: How do I implement a Last Page Footer different from other pages?

Post by Costin »

I assume your using FOP to do the transformation and you already have some XSLT customization that overrides the standard one provided by DITA-OT.

I prepared a static FO example showing a last page footer with a bottom margin of the last page different from the one applied to the rest of the pages. If you want to make it behave dynamic, you could use a heuristic to infer the size of the footer from the length of its text, then change the simple page master bottom margin and region-after dimension.

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:css="http://www.w3.org/1998/CSS"
xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xml:lang="dflt">
<fo:layout-master-set>
<!-- Page: psm-->
<fo:page-sequence-master master-name="psm">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference master-reference="spm-psm-last"
odd-or-even="any" page-position="last" blank-or-not-blank="any"/>
<fo:conditional-page-master-reference master-reference="spm-psm"
odd-or-even="any" page-position="any" blank-or-not-blank="any"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
<fo:simple-page-master master-name="spm-psm-last" page-width="8.5in"
page-height="11in">
<fo:region-body
margin-top="1in" margin-bottom="5in" margin-left="1in"
margin-right="1in"/>
<fo:region-before region-name="sc-before-last" extent="1in"/>
<fo:region-after region-name="sc-after-last" extent="5in"/>
<fo:region-start region-name="sc-start-last" extent="1in"/>
<fo:region-end region-name="sc-end-last" extent="1in"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="spm-psm" page-width="8.5in"
page-height="11in">
<fo:region-body margin-top="1in" margin-bottom="1in" margin-left="1in"
margin-right="1in"/>
<fo:region-before region-name="sc-before" extent="1in"/>
<fo:region-after region-name="sc-after" extent="1in"/>
<fo:region-start region-name="sc-start" extent="1in"/>
<fo:region-end region-name="sc-end" extent="1in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:declarations>
<x:xmpmeta xmlns:x="adobe:ns:meta/">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description>
<xmp:CreatorTool xmlns:xmp="http://ns.adobe.com/xap/1.0/">oXygen PDF Chemistry
Version 20.0 Build 2018-03-05T11:55:07Z</xmp:CreatorTool>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
</fo:declarations>
<fo:page-sequence master-reference="psm" force-page-count="no-force"
id="last-page-sequence" line-height-shift-adjustment="disregard-shifts">
<fo:static-content flow-name="sc-after-last" role="artifact" >
<fo:table border-collapse="separate" table-layout="fixed" width="100%" background-color="yellow">
<fo:table-body>
<fo:table-row>
<!--BOTTOM-CENTER-->
<fo:table-cell start-indent="0" end-indent="0" height="1in"
width="(8.5in - 1in - 1in)" text-align="center" display-align="center"
background-color="pink">
<fo:block> Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom </fo:block>
<fo:block> Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom </fo:block>
<fo:block> Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom </fo:block>
<fo:block> Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom </fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block
font-family="serif, Times, Times New Roman, Symbol, MingLiU, MS Mincho, Arial Unicode MS"
font-size="12pt">
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test 1</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test 2</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test 3</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test 1</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test 2</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test 3</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test 1</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test 2</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test 3</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test 1</fo:block>
</fo:block-container>
<fo:block-container margin-bottom="1in" margin-left="1in" margin-right="1in"
margin-top="1in">
<fo:block end-indent="0" start-indent="0">Test 2</fo:block>
</fo:block-container>

</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
GregWait
Posts: 10
Joined: Thu Apr 21, 2016 8:49 pm

Re: PDF: How do I implement a Last Page Footer different from other pages?

Post by GregWait »

Costin,

Thanks for that. I think I'm not explaining my problem well.

I think the transformation is not recognizing the last page. I have rules in place that should apply to the last page, but they do not get applied; my rules for other pages (after first) are getting applied.

What has to happen to make the transform recognize which page is LAST?

Thanks,
Greg
Dan
Posts: 501
Joined: Mon Feb 03, 2003 10:56 am

Re: PDF: How do I implement a Last Page Footer different from other pages?

Post by Dan »

Is hard to tell what is wrong. We are not doing XSLT customization but we will try to help you by taking a look at your plugin. Please use the https://www.oxygenxml.com/techSupport.html form to send it to us.

Many regards,
Dan
Post Reply