Re: Fo2Docx Query: Fetch total number of pages

"Shankar Maddala, Uma" <[email protected]> Fri, 24 Jul 2026 12:41:56 +0000
Newsgroups gmane.text.xml.xfc.general
Message-ID <CH3PR84MB3734045C9E2057E18D20CA87BECF2@CH3PR84MB3734.NAMPRD84.PROD.OUTLOOK.COM>
--===============5890692518654591962==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_CH3PR84MB3734045C9E2057E18D20CA87BECF2CH3PR84MB3734NAMP_"

--_000_CH3PR84MB3734045C9E2057E18D20CA87BECF2CH3PR84MB3734NAMP_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Thank you. This worked.

Best Regards,
Uma Shankar M

________________________________
From: Hussein Shafie <[email protected]>
Sent: Friday, July 24, 2026 4:42 PM
To: Shankar Maddala, Uma <[email protected]>
Cc: [email protected] <[email protected]>; Navath, Roopesh <roo=
[email protected]>
Subject: Re: [XFC] Fo2Docx Query: Fetch total number of pages

Uma S. M. wrote:
>  We are using FO2DOCX to generate Docx output from FO files. We want to p=
rint total page count in the footer as "Page X of Y". We tried <fo:page-num=
ber-citation-last/> but this does not seem to be supported by XFC.

Yes. fo:page-number-citation-last is part of XSL-FO v1.1
(https://urldefense.com/v3/__https://www.w3.org/TR/xsl11/__;!!NpxR!mGCWPlYf=
t1fx2fT7mcyIy5tiuaeGZBLp_VtG-5gLhnDYmDgjlvWQzSKVjG_t_NrZcqYbzXONLuSn_RF0w_V=
DvUo$ ) while XMLmind XSL-FO Converter only
supports XSL-FO v1.0 (https://urldefense.com/v3/__https://www.w3.org/TR/200=
1/REC-xsl-20011015/__;!!NpxR!mGCWPlYft1fx2fT7mcyIy5tiuaeGZBLp_VtG-5gLhnDYmD=
gjlvWQzSKVjG_t_NrZcqYbzXONLuSn_RF0zvz3R_M$ ).



>
> Can you please let us know how to generate total page count in Docx outpu=
t?

1) Add

<fo:block id=3D"end"></fo:block>

at the very end of your document (e.g. your last
<fo:page-sequence>/<fo:flow>)

2) Insert

<fo:page-number-citation ref-id=3D"end" />

wherever you need the total page count.

See attached sample XSL-FO file (one of our many test
[email protected]) using this technique.

--_000_CH3PR84MB3734045C9E2057E18D20CA87BECF2CH3PR84MB3734NAMP_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div class=3D"elementToProof" style=3D"font-family: &quot;HPE Graphik&quot;=
; font-size: 11pt; color: rgb(0, 36, 81);">
Thank you. This worked.</div>
<div id=3D"Signature" class=3D"elementToProof">
<div class=3D"elementToProof" style=3D"font-family: &quot;HPE Graphik&quot;=
; font-size: 11pt; color: rgb(0, 36, 81);">
<br>
</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
background-color: rgb(255, 255, 255); margin: 0px; font-family: &quot;Palat=
ino Linotype&quot;; font-size: 13.3333px; color: maroon;">
Best Regards,</div>
<div class=3D"elementToProof" style=3D"text-align: left; text-indent: 0px; =
background-color: rgb(255, 255, 255); margin: 0px; font-family: &quot;Bookm=
an Old Style&quot;; font-size: 13.5pt; color: purple;">
Uma Shankar M</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
</div>
<div id=3D"appendonsend"></div>
<hr style=3D"display:inline-block;width:98%" tabindex=3D"-1">
<div id=3D"divRplyFwdMsg" dir=3D"ltr"><font face=3D"Calibri, sans-serif" st=
yle=3D"font-size:11pt" color=3D"#000000"><b>From:</b> Hussein Shafie &lt;hu=
[email protected]&gt;<br>
<b>Sent:</b> Friday, July 24, 2026 4:42 PM<br>
<b>To:</b> Shankar Maddala, Uma &lt;[email protected]&gt;<br>
<b>Cc:</b> [email protected] &lt;[email protected]&gt;; Navath,=
 Roopesh &lt;[email protected]&gt;<br>
<b>Subject:</b> Re: [XFC] Fo2Docx Query: Fetch total number of pages</font>
<div>&nbsp;</div>
</div>
<div class=3D"BodyFragment"><font size=3D"2"><span style=3D"font-size:11pt;=
">
<div class=3D"PlainText">Uma S. M. wrote:<br>
&gt;&nbsp; We are using FO2DOCX to generate Docx output from FO files. We w=
ant to print total page count in the footer as &quot;Page X of Y&quot;. We =
tried &lt;fo:page-number-citation-last/&gt; but this does not seem to be su=
pported by XFC.<br>
<br>
Yes. fo:page-number-citation-last is part of XSL-FO v1.1 <br>
(<a href=3D""></a>https://urldefense.com/v3/__https://www.w3.org/TR/xsl11/_=
_;!!NpxR!mGCWPlYft1fx2fT7mcyIy5tiuaeGZBLp_VtG-5gLhnDYmDgjlvWQzSKVjG_t_NrZcq=
YbzXONLuSn_RF0w_VDvUo$ ) while XMLmind XSL-FO Converter only
<br>
supports XSL-FO v1.0 (<a href=3D""></a>https://urldefense.com/v3/__https://=
www.w3.org/TR/2001/REC-xsl-20011015/__;!!NpxR!mGCWPlYft1fx2fT7mcyIy5tiuaeGZ=
BLp_VtG-5gLhnDYmDgjlvWQzSKVjG_t_NrZcqYbzXONLuSn_RF0zvz3R_M$ ).<br>
<br>
<br>
<br>
&gt; <br>
&gt; Can you please let us know how to generate total page count in Docx ou=
tput? <br>
<br>
1) Add<br>
<br>
&lt;fo:block id=3D&quot;end&quot;&gt;&lt;/fo:block&gt;<br>
<br>
at the very end of your document (e.g. your last <br>
&lt;fo:page-sequence&gt;/&lt;fo:flow&gt;)<br>
<br>
2) Insert<br>
<br>
&lt;fo:page-number-citation ref-id=3D&quot;end&quot; /&gt;<br>
<br>
wherever you need the total page count.<br>
<br>
See attached sample XSL-FO file (one of our many test <br>
[email protected]) using this technique.<br>
</div>
</span></font></div>
</body>
</html>

--_000_CH3PR84MB3734045C9E2057E18D20CA87BECF2CH3PR84MB3734NAMP_--

--===============5890692518654591962==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--
XMLmind FO Converter Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xfc-support

--===============5890692518654591962==--