Bug 53580 - [PATCH] force-page-count 'doubly-even' and 'end-on-doubly-even' extension
Summary: [PATCH] force-page-count 'doubly-even' and 'end-on-doubly-even' extension
Status: NEW
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: page-master/layout (show other bugs)
Version: all
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-21 21:01 UTC by Matthias Reischenbacher
Modified: 2012-07-23 20:46 UTC (History)
0 users



Attachments
Patch (6.77 KB, patch)
2012-07-21 21:01 UTC, Matthias Reischenbacher
Details | Diff
Patch (9.41 KB, patch)
2012-07-23 20:45 UTC, Matthias Reischenbacher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Reischenbacher 2012-07-21 21:01:35 UTC
Created attachment 29092 [details]
Patch

I implemented a non-standard value for the force-page-count property: 'end-on-fourth'. The new value forces a page-sequence to have a total page count dividable by four.

This feature has been requested on the mailing list [1] and by several of my clients. The alternatives (a) PDF post processing tools or (b) manipulating the area tree are not very practical due to difficult handling of static content for headers and footers.

[1] http://apache-fop.1065347.n5.nabble.com/How-to-make-sure-PDF-ends-with-a-fourth-page-td16188.html
Comment 1 Matthias Reischenbacher 2012-07-23 13:48:14 UTC
I just checked how Antenna House handles this use case. The extended property values used by AH are:
* doubly-even
* end-on-doubly-even
* doubly-even-document

See also:
http://www.antennahouse.com/xslfo/extension.htm#force-page-count

I will rework my patch a bit in order to comply with AH. Does anybody know if RenderX provides a similar functionality?
Comment 2 Alex Giotis 2012-07-23 14:26:00 UTC
I have not used it, but RenderX seems to support it too. See footnote [1] in XEP User Guide - Appendix A. XSL-FO Conformance

[1] http://www.renderx.com/reference.html#ftn.d0e11055
Comment 3 Matthias Reischenbacher 2012-07-23 20:37:54 UTC
Alex, thanks for the pointer. I went with the AntennaHouse approach because it also takes into account the number of pages of the page-sequence and not only the total amount of pages.
For now I didn't add support for a more flexible configuration of a page number, but I might in the future if it becomes an requirement. Updated patch coming shortly....
Comment 4 Matthias Reischenbacher 2012-07-23 20:45:34 UTC
Created attachment 29101 [details]
Patch

New patch which implements the following two force-page-count property values:

* doubly-even
--> forces a doubly even amount of pages in the current page-sequence (e.g. page-sequence has pages 4-8 or 5-13 etc.)

* end-on-doubly-even
--> forces to end the current page-sequence on a doubly-even number of pages (e.g. last page must be page nr 4 or 8 etc.)