Page 1 of 1

Questions about the PDF output - page breaks

PostPosted: Tue Aug 24, 2010 7:09 am
by heitorflorido
Hello,

Does anyone know why some page breaks aren't rendered and some are?
On log output appears:
Code: Select all
*ERROR* MainDocumentPart: UNEXPECTED: org.docx4j.wml.Br (MainDocumentPart.java, line 562)

But I can't find a reason for that.

Thanks

Re: Questions about the PDF output

PostPosted: Tue Aug 24, 2010 8:57 am
by jason
Sounds like a bug. Please post the XML for the page breaks which are ignored, and I'll fix it straight away.

Re: Questions about the PDF output - page breaks

PostPosted: Wed Aug 25, 2010 12:03 am
by heitorflorido
Here's the XML part of one ignored page break:
Code: Select all
<w:p w:rsidRDefault="003F130F" w:rsidR="003F130F" w:rsidRPr="00F060EA">
<w:pPr>
<w:pStyle w:val="Textodecomentrio" />
<w:spacing w:lineRule="auto" w:line="312" />
<w:rPr>
<w:rFonts w:hAnsi="Calibri" w:ascii="Calibri" />
<w:sz w:val="24" />
<w:szCs w:val="24" />
</w:rPr>
</w:pPr>
<w:r w:rsidRPr="00F060EA">
<w:rPr>
<w:rFonts w:hAnsi="Calibri" w:ascii="Calibri" />
<w:sz w:val="24" />
<w:szCs w:val="24" />
</w:rPr>
<w:lastRenderedPageBreak />
<w:br w:type="page" />
</w:r>
</w:p>

While a page break that is rendered (inserted using docx4j) gives the XML:
Code: Select all
<w:br w:type="page" />


Thanks

Re: Questions about the PDF output - page breaks

PostPosted: Wed Aug 25, 2010 12:58 pm
by jason
I created a test docx with the following content:
Code: Select all
        <w:body>
          <w:p>
            <w:r>
              <w:t>A</w:t>
            </w:r>
          </w:p>
          <w:p>
            <w:r>
              <w:br w:type="page"/>
            </w:r>
          </w:p>
          <w:p>
            <w:r>
              <w:t>B</w:t>
            </w:r>
          </w:p>

          <w:p>
            <w:r>
              <w:t>C</w:t>
              <w:br w:type="page"/>
            </w:r>
          </w:p>

          <w:p>
            <w:r>
              <w:br w:type="page"/>
              <w:t>D</w:t>
            </w:r>
          </w:p>

          <w:p>
            <w:r>
              <w:t>E</w:t>
            </w:r>
            <w:r>
              <w:br w:type="page"/>
            </w:r>
          </w:p>

          <w:p>
            <w:r>
              <w:t>F</w:t>
            </w:r>
          </w:p>



docx4j pdf output had the same page breaks as Word did.

So you'll need to provide a test case please.