[xep-support] Re: Initial-page-number cause repeat of first page

Darren Munt darrenm at ardex.com.au
Wed Dec 16 15:46:02 PST 2015


OK, once I realised it was a mistake to just copy and paste that from the email, because it rejected the smart quotes, that now works. So thanks for that!

From: Kevin Brown [mailto:kevin at renderx.com]
Sent: Thursday, 17 December 2015 5:49 AM
To: 'RenderX Community Support List'
Cc: Darren Munt
Subject: RE: [xep-support] Re: Initial-page-number cause repeat of first page

And also to be clear, CORE options are children of <options>.
So add this at the same level as KERN, VALIDATE, etc.

Kevin Brown
RenderX

From: Xep-support [mailto:xep-support-bounces at renderx.com] On Behalf Of Kevin Brown
Sent: Wednesday, December 16, 2015 10:24 AM
To: 'RenderX Community Support List' <xep-support at renderx.com<mailto:xep-support at renderx.com>>
Subject: [xep-support] Re: Initial-page-number cause repeat of first page

In your xep.xml, do you have ENABLE_PAGE_NUMBERS ?
If you do not, in the CORE section in xep.xml, add:

<option name="ENABLE_PAGE_NUMBERS" value="true"/>

Remove your forced setting of the initial page number and try again.

See http://www.renderx.com/reference.html#Document_Injection

Specifically this note:

"Since XSL-FO formatting, including page number calculation, occurs before PDF injection, the second <fo:page-sequence> will get page number 42, while it should be 45. The further pages will also contain wrong links. To mitigate this, a special post-formatting run is applied just before the XEPOUT is sent to the output stream. During this run, the page references are adjusted, e.g. the page numbers are incremented by 3 (number of pages in an injected PDF) to match actual numbering. XEP versions prior to 4.22 have not marked page numbers in any way, so it was impossible to distinguish them from the common text, hence to adjust page numbers. XEP 4.22 introduces a core option ENABLE_PAGE_NUMBERS that enables marking such text elements with <xep:page-numbers> tag and thus makes it possible to adjust the values when necessary. One doesn't need to enable this option if no page number calculation occurs in the document. However, if page numbers are calculated, and any PDF injection occurs, this option must be turned to true, and any post-processing scripts must be adjusted to recognize <xep:page-numbers> along with the usual<xep:text>."

Kevin Brown
RenderX

From: Xep-support [mailto:xep-support-bounces at renderx.com] On Behalf Of Darren Munt
Sent: Tuesday, December 15, 2015 11:08 PM
To: xep-support at renderx.com<mailto:xep-support at renderx.com>
Subject: [xep-support] Initial-page-number cause repeat of first page

I have a document which includes an existing PDF using the rx:insert-document extension. I want the subsequent pages to commence numbering from the appropriate page number taking into consideration the length of the inserted document. So I have used the initial-page-number attribute to specify the starting point. The page sequence looks like this:

<fo:page-sequence master-reference="contentpage" rx:insert-document="url(myinserteddoc.pdf)" initial-page-number="3">

There is one page sequence before this which produces one page of output, and the inserted document is also one page long. Without the initial-page-number attribute, the content generated is:

Page 1: My first page sequence (happens to be a cover page)
Page 2: My inserted doc (which has "Page 2" hard-coded)
Page 3: My second page sequence, numbered "Page 2" but is actually the 3rd page of output.

When I include the initial-page-number attribute as per above, I get the first page repeated. So the final output is:

Page 1: My cover page
Page 2: My cover page again
Page 3: My inserted doc
Page 4: My second page sequence, correctly numbered "Page 3" but is actually the 4th page of output.

I realise this is because my initial page numbering is resulting in an odd page without a matching even page - although why it is choosing to repeat the first page instead of inserting a blank page I'm not sure.

Is there a way of overriding this behaviour so that I can have the page numbering run to include my inserted document and not have additional inserted pages if the next page after the inserted document happens to be odd?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20151217/9f5d71f3/attachment.html>


More information about the Xep-support mailing list