<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 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 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:0cm;
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";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle19
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
span.EmailStyle21
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
span.EmailStyle25
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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-AU link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>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!<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 #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Kevin Brown [mailto:kevin@renderx.com] <br><b>Sent:</b> Thursday, 17 December 2015 5:49 AM<br><b>To:</b> 'RenderX Community Support List'<br><b>Cc:</b> Darren Munt<br><b>Subject:</b> RE: [xep-support] Re: Initial-page-number cause repeat of first page<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>And also to be clear, CORE options are children of <options>.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>So add this at the same level as KERN, VALIDATE, etc.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Kevin Brown<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>RenderX<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US>From:</span></b><span lang=EN-US> Xep-support [<a href="mailto:xep-support-bounces@renderx.com">mailto:xep-support-bounces@renderx.com</a>] <b>On Behalf Of </b>Kevin Brown<br><b>Sent:</b> Wednesday, December 16, 2015 10:24 AM<br><b>To:</b> 'RenderX Community Support List' <<a href="mailto:xep-support@renderx.com">xep-support@renderx.com</a>><br><b>Subject:</b> [xep-support] Re: Initial-page-number cause repeat of first page<o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>In your xep.xml, do you have </span><code><i><span lang=EN-US style='font-size:10.0pt;color:black;background:white'>ENABLE_PAGE_NUMBERS</span></i></code><span class=apple-converted-space><span lang=EN-US style='font-size:8.5pt;font-family:"Verdana","sans-serif";color:black;background:white'> ?</span></span><span lang=EN-US style='color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US 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 lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US 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 lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US 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 lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Specifically this note:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>“</span><span lang=EN-US 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 lang=EN-US style='font-size:8.5pt;color:black;background:white'><fo:page-sequence></span></code><span class=apple-converted-space><span lang=EN-US style='font-size:8.5pt;font-family:"Verdana","sans-serif";color:black;background:white'> </span></span><span lang=EN-US 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 lang=EN-US style='font-size:10.0pt;color:black;background:white'>ENABLE_PAGE_NUMBERS</span></i></code><span class=apple-converted-space><span lang=EN-US style='font-size:8.5pt;font-family:"Verdana","sans-serif";color:black;background:white'> </span></span><span lang=EN-US 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 lang=EN-US style='font-size:8.5pt;color:black;background:white'><xep:page-numbers></span></code><span class=apple-converted-space><span lang=EN-US style='font-size:8.5pt;font-family:"Verdana","sans-serif";color:black;background:white'> </span></span><span lang=EN-US 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 lang=EN-US style='font-size:8.5pt;color:black;background:white'><xep:page-numbers></span></code><span class=apple-converted-space><span lang=EN-US style='font-size:8.5pt;font-family:"Verdana","sans-serif";color:black;background:white'> </span></span><span lang=EN-US style='font-size:8.5pt;font-family:"Verdana","sans-serif";color:black;background:white'>along with the usual</span><code><span lang=EN-US style='font-size:8.5pt;color:black;background:white'><xep:text></span></code><span lang=EN-US style='font-size:8.5pt;font-family:"Verdana","sans-serif";color:black;background:white'>.”</span><span lang=EN-US style='color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Kevin Brown<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>RenderX<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US>From:</span></b><span lang=EN-US> Xep-support [<a href="mailto:xep-support-bounces@renderx.com">mailto:xep-support-bounces@renderx.com</a>] <b>On Behalf Of </b>Darren Munt<br><b>Sent:</b> Tuesday, December 15, 2015 11:08 PM<br><b>To:</b> <a href="mailto:xep-support@renderx.com">xep-support@renderx.com</a><br><b>Subject:</b> [xep-support] Initial-page-number cause repeat of first page<o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal>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></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><fo:page-sequence master-reference="contentpage" rx:insert-document="url(myinserteddoc.pdf)" initial-page-number="3"><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Page 1: My first page sequence (happens to be a cover page)<o:p></o:p></p><p class=MsoNormal>Page 2: My inserted doc (which has “Page 2” hard-coded)<o:p></o:p></p><p class=MsoNormal>Page 3: My second page sequence, numbered “Page 2” but is actually the 3rd page of output.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Page 1: My cover page<o:p></o:p></p><p class=MsoNormal>Page 2: My cover page again<o:p></o:p></p><p class=MsoNormal>Page 3: My inserted doc <o:p></o:p></p><p class=MsoNormal>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></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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></p></div></body></html>