<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
code
{mso-style-priority:99;
font-family:"Courier New";}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>In your xep.xml, do you have </span><code><i><span style='font-size:10.0pt;color:black;background:white'>ENABLE_PAGE_NUMBERS</span></i></code><span class=apple-converted-space><span style='font-size:8.5pt;font-family:"Verdana",sans-serif;color:black;background:white'> ?</span></span><span style='color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>If you do not, in the CORE section in xep.xml, add:<br><br><option name=”ENABLE_PAGE_NUMBERS” value=”true”/><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Remove your forced setting of the initial page number and try again.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>See <a href="http://www.renderx.com/reference.html#Document_Injection">http://www.renderx.com/reference.html#Document_Injection</a><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Specifically this note:<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>“</span><span style='font-size:8.5pt;font-family:"Verdana",sans-serif;color:black;background:white'>Since XSL-FO formatting, including page number calculation, occurs before PDF injection, the second<span class=apple-converted-space> </span></span><code><span style='font-size:8.5pt;color:black;background:white'><fo:page-sequence></span></code><span class=apple-converted-space><span style='font-size:8.5pt;font-family:"Verdana",sans-serif;color:black;background:white'> </span></span><span style='font-size:8.5pt;font-family:"Verdana",sans-serif;color:black;background:white'>will get page number<span class=apple-converted-space> </span><em><span style='font-family:"Verdana",sans-serif'>42</span></em>, while it should be<span class=apple-converted-space> </span><em><span style='font-family:"Verdana",sans-serif'>45</span></em>. 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<span class=apple-converted-space> </span><em><span style='font-family:"Verdana",sans-serif'>3</span></em><span class=apple-converted-space> </span>(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 </span><code><i><span style='font-size:10.0pt;color:black;background:white'>ENABLE_PAGE_NUMBERS</span></i></code><span class=apple-converted-space><span style='font-size:8.5pt;font-family:"Verdana",sans-serif;color:black;background:white'> </span></span><span style='font-size:8.5pt;font-family:"Verdana",sans-serif;color:black;background:white'>that enables marking such text elements with<span class=apple-converted-space> </span></span><code><span style='font-size:8.5pt;color:black;background:white'><xep:page-numbers></span></code><span class=apple-converted-space><span style='font-size:8.5pt;font-family:"Verdana",sans-serif;color:black;background:white'> </span></span><span style='font-size:8.5pt;font-family:"Verdana",sans-serif;color:black;background:white'>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 <em><span style='font-family:"Verdana",sans-serif'>true</span></em>, and any post-processing scripts must be adjusted to recognize<span class=apple-converted-space> </span></span><code><span style='font-size:8.5pt;color:black;background:white'><xep:page-numbers></span></code><span class=apple-converted-space><span style='font-size:8.5pt;font-family:"Verdana",sans-serif;color:black;background:white'> </span></span><span style='font-size:8.5pt;font-family:"Verdana",sans-serif;color:black;background:white'>along with the usual</span><code><span style='font-size:8.5pt;color:black;background:white'><xep:text></span></code><span style='font-size:8.5pt;font-family:"Verdana",sans-serif;color:black;background:white'>.”</span><span style='color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Kevin Brown<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>RenderX<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> Xep-support [mailto:xep-support-bounces@renderx.com] <b>On Behalf Of </b>Darren Munt<br><b>Sent:</b> Tuesday, December 15, 2015 11:08 PM<br><b>To:</b> xep-support@renderx.com<br><b>Subject:</b> [xep-support] Initial-page-number cause repeat of first page<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-AU>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:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-AU><fo:page-sequence master-reference="contentpage" rx:insert-document="url(myinserteddoc.pdf)" initial-page-number="3"><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-AU>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:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-AU>Page 1: My first page sequence (happens to be a cover page)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU>Page 2: My inserted doc (which has “Page 2” hard-coded)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU>Page 3: My second page sequence, numbered “Page 2” but is actually the 3rd page of output.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-AU>When I include the initial-page-number attribute as per above, I get the first page repeated. So the final output is:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-AU>Page 1: My cover page<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU>Page 2: My cover page again<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU>Page 3: My inserted doc <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU>Page 4: My second page sequence, correctly numbered “Page 3” but is actually the 4<sup>th</sup> page of output.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-AU>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.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-AU>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?<o:p></o:p></span></p></div></body></html>