[ https://issues.apache.org/jira/browse/FOP-3090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17708886#comment-17708886 ]
Dave Roxburgh commented on FOP-3090: ------------------------------------ Attachments: - patch_xmlgraphics-fop_FOP-3090_02.diff - patch_xmlgraphics-website_FOP-3090_02.diff The attached patches resolve this issue by adding a new configuration setting. As explained in the documentation (website) patch: skip-page-position-only-allowed When set to false, a second page with no content in the body (but other content such as region-after) may be produced when a conditional-page-master-reference with page-position="only" is a master candidate. Ordinarily (i.e. when this setting not set to false), the processor will consider using conditional-page-master-references with page-position="only" one time only; if it fails to successfully construct the document on the first attempt, these conditional-page-master-references are ignored in further attempts. This default behaviour avoids the output of a 'blank' page - a second page with no content in the body where the processor fails to fit all the content onto a single page. In some cases however, this final page devoid of any body content is required and setting skip-page-position-only-allowed to false will allow this second page with no body content to be output. A specific example of the use of this flag is where a simple-page-master with page-position="only" specifies a large region-after and the amount of content is such that the processor cannot quite fit the body content and the large region-after onto one page. The processor will then produce a second page and fall back to using alternative simple-page-masters which have smaller region-afters and so the content and smaller region-after will fit on the first page and the second page will have no content in the body. The default behaviour will be to suppress that second page with no body content. But if skip-page-position-only-allowed is set to false the second page will be produced. -- [~Franziska] , Thanks for raising this ticket. Once the patch is merged you can pull from trunk and build FOP from there. Or wait for the nightly build and take the binary. If you don't want to work from trunk, a potential workaround to this issue may be to use something like force-page-count="end-on-even" in your page-sequence to force at least two pages to be produced. > Incorrect page creation with master-reference="singlePage" > page-position="only"/> > --------------------------------------------------------------------------------- > > Key: FOP-3090 > URL: https://issues.apache.org/jira/browse/FOP-3090 > Project: FOP > Issue Type: Bug > Components: layout/page > Affects Versions: 2.7 > Environment: Windows 10 > Reporter: Franziska Zäch > Priority: Major > Attachments: Codelist_Template.xsl, CommonTemplateFO.xsl, > INVOICFO.xsl, INVOICFO.xsl, Mustermann.2.7.pdf, Mustermann.pdf, > Mustermann.xml, Mustermann.xml, Mustermann_Test_2.7.pdf, > Mustermann_big_ok.xml, Mustermann_big_ok.xml, Mustermann_big_ok.xml.pdf, > Mustermann_big_ok.xml.pdf, Mustermann_short_ok.xml, > Mustermann_short_ok.xml.pdf, TextAusgabePDF.xml, fop_invoic.bat, > patch_xmlgraphics-fop_FOP-3090_02.diff, > patch_xmlgraphics-website_FOP-3090_02.diff > > > After upgrading FOP 1. 1 to FOP 2. 7, the “Single Page” is no longer created > correctly if a 2nd page is to be created due to the data volume in “body” and > a region-after extent=”11. 8cm. > See appendix template. pdf: Here a 2nd page is created due to the data volume > (body)! > See Appendix Mustermann 2. 7. pdf: Due to the data volume (body) a 2nd page > should be created here! > Note: the bank details should only be printed once per document! > Note: with the FOP version 2. 6 the PDF is created correctly! > <fo:simple-page-master master-name="{color:#ff0000}singlePage{color}" > page-height="297mm" page-width="210mm" margin-top="15mm" margin-bottom="0mm" > margin-left="3mm" margin-right="2mm"> > <fo:region-body region-name="{color:#ff0000}body{color}" > margin-top="2.4cm" margin-b{color:#ff0000}ottom="11.8cm{color}" > margin-left="10mm"/> > <fo:region-before extent="2cm" > region-name="xsl-region-before"/> > <{color:#ff0000}fo:region-after extent="11.8cm{color}" > region-name="last-region-after" margin-right="40mm" display-align="after"/> > <fo:region-start extent="1cm" > region-name="xsl-region-start"/> > </fo:simple-page-master> > > <fo:page-sequence-master master-name="basicPSM"> > <fo:repeatable-page-master-alternatives> > <fo:conditional-page-master-reference > master-reference="singlePage" page-position="only"/> > -- This message was sent by Atlassian Jira (v8.20.10#820010)