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

From: Darren Munt <darrenm_at_ADDRESS_REMOVED>
Date: Fri Dec 18 2015 - 14:39:42 PST

I've had to roll back this change to xep.xml because it is producing some weird results in several documents now. For example I am getting apparently random page numbering like this:

Page 1, 2, 3, 4, 9, 9, 9, 9, 9, 11, 11, 13, 13, 15, 15, 16, 17

If I remove the ENABLE_PAGE_NUMBERS option the problem goes away. The document is composed of a series of page-sequences. I'm not setting initial page numbering anywhere.

There's obviously something about my FO that is causing it, so happy to send that if it would help.

From: Kevin Brown [mailto:kevin@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

From: Xep-support [mailto:xep-support-bounces@renderx.com] On Behalf Of Kevin Brown
Sent: Wednesday, December 16, 2015 10:24 AM
To: 'RenderX Community Support List' <xep-support@renderx.com<mailto:xep-support@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

From: Xep-support [mailto:xep-support-bounces@renderx.com] On Behalf Of Darren Munt
Sent: Tuesday, December 15, 2015 11:08 PM
To: xep-support@renderx.com<mailto:xep-support@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?

(*) To unsubscribe, please visit http://lists.renderx.com/mailman/options/xep-support
(*) By using the Service, you expressly agree to these Terms of Service http://w
Received on Fri Dec 18 14:41:07 2015

This archive was generated by hypermail 2.1.8 : Fri Dec 18 2015 - 14:41:21 PST