Page numbers in the footer are not being rendered correctly. I have the form: Page 'a' of 'b'.
Suppose I have a document with more than one page the result I get is:
[*]Page 1 of 1
[*]Page 2 of 2
[*]Page 3 of 3
but I want to display:
[*]Page 1 of 3
[*]Page 2 of 3
[*]Page 3 of 3
I'm using the org.docx4j.convert.out.pdf.viaXSLFO.Conversion converter
and the org.docx4j.samples.CreatePdf for test.
I suppose what happens is that Docx4j supports
<w:instrText xml:space="preserve"> PAGE \* Arabic </w:instrText>
but does not support
<w:instrText xml:space="preserve"> NUMPAGES \* Arabic </w:instrText>
Can you help me with this please?
Thanks
This is the footer xml:
- Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<w:ftr mc:Ignorable="w14 wp14" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w10="urn:schemas-microsoft-com:office:word"
xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"
xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas"
xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"
xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk"
xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape">
<w:p w:rsidP="007F459B" w:rsidR="007F459B" w:rsidRDefault="007F459B">
<w:pPr>
<w:pStyle w:val="Footer"/>
<w:jc w:val="right"/>
</w:pPr>
<w:r>
<w:rPr>
<w:lang w:val="es-ES"/>
</w:rPr>
<w:t xml:space="preserve">Página </w:t>
</w:r>
<w:r w:rsidR="00C40CF5">
<w:rPr>
<w:lang w:val="es-ES"/>
</w:rPr>
<w:fldChar w:fldCharType="begin"/>
</w:r>
<w:r w:rsidR="00C40CF5">
<w:rPr>
<w:lang w:val="es-ES"/>
</w:rPr>
<w:instrText xml:space="preserve"> PAGE \* Arabic </w:instrText>
</w:r>
<w:r w:rsidR="00C40CF5">
<w:rPr>
<w:lang w:val="es-ES"/>
</w:rPr>
<w:fldChar w:fldCharType="separate"/>
</w:r>
<w:r w:rsidR="00216BAA">
<w:rPr>
<w:noProof/>
<w:lang w:val="es-ES"/>
</w:rPr>
<w:t>1</w:t>
</w:r>
<w:r w:rsidR="00C40CF5">
<w:rPr>
<w:lang w:val="es-ES"/>
</w:rPr>
<w:fldChar w:fldCharType="end"/>
</w:r>
<w:r>
<w:rPr>
<w:lang w:val="es-ES"/>
</w:rPr>
<w:t xml:space="preserve"> de </w:t>
</w:r>
<w:r w:rsidR="00C40CF5">
<w:rPr>
<w:lang w:val="es-ES"/>
</w:rPr>
<w:fldChar w:fldCharType="begin"/>
</w:r>
<w:r w:rsidR="00C40CF5">
<w:rPr>
<w:lang w:val="es-ES"/>
</w:rPr>
<w:instrText xml:space="preserve"> NUMPAGES \* Arabic </w:instrText>
</w:r>
<w:r w:rsidR="00C40CF5">
<w:rPr>
<w:lang w:val="es-ES"/>
</w:rPr>
<w:fldChar w:fldCharType="separate"/>
</w:r>
<w:r w:rsidR="00216BAA">
<w:rPr>
<w:noProof/>
<w:lang w:val="es-ES"/>
</w:rPr>
<w:t>1</w:t>
</w:r>
<w:r w:rsidR="00C40CF5">
<w:rPr>
<w:lang w:val="es-ES"/>
</w:rPr>
<w:fldChar w:fldCharType="end"/>
</w:r>
</w:p>
<w:p w:rsidP="007E4D43" w:rsidR="007E4D43" w:rsidRDefault="007E4D43">
<w:pPr>
<w:pStyle w:val="Footer"/>
<w:jc w:val="right"/>
</w:pPr>
</w:p>
</w:ftr>