Page 1 of 1

docx to Pdf - page break on first paragraph

PostPosted: Sat May 28, 2011 3:50 am
by looker
Hi Jason,

The difference in document.xml between empty docx document and mine, i presume is this one:
Code: Select all
<w:pPr>
<w:pStyle w:val="Heading0"/>
<w:numPr>
<w:ilvl w:val="0"/>
<w:numId w:val="0"/>
</w:numPr>
<w:jc w:val="left"/>
</w:pPr>
<w:r>
<w:t>DD</w:t>
</w:r>
</w:p>


The xml difference doesn't seem too strange but for some reason I am getting the following exception when converting to Pdf:

Caused by: java.lang.IllegalArgumentException: Only non-null Positions with an index can be checked

Do you have an idea why?

Re: docx convert to Pdf - java.lang.IllegalArgumentException

PostPosted: Mon May 30, 2011 1:56 am
by jason
With current svn (and recent and not so recent nightlies), the PDF displays, but doesn't show your content :-(

The XSL-FO:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
     <fo:list-block provisional-distance-between-starts="0.5in">
        <fo:list-item>
          <fo:list-item-label>
            <fo:block/>
          </fo:list-item-label>
          <fo:list-item-body start-indent="body-start()">
            <fo:block break-before="page" font-family="Times New Roman" font-size="14.0pt" font-weight="bold" space-after="0.33in"
                     space-before="0.75in" text-align="left" vertical-align="baseline">DD</fo:block>
          </fo:list-item-body>
        </fo:list-item>
      </fo:list-block>
 
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


Note the @break-before="page". This seems to be confusing FOP. I suspect its a bug; please check https://issues.apache.org/bugzilla/bugl ... eak-before

In any case the XSL FO emitted by docx4j shouldn't write that on the first p in the document (ie it should as a special case ignore what the style says, like Word).

Re: docx to Pdf - page break on first paragraph

PostPosted: Tue Jun 26, 2012 10:35 pm
by mfruizs2
I had got same problem, but the beginning of the issue was that the document at the beginning was "*.doc" and not "*.docx" ... :P

regard!

Re: docx to Pdf - page break on first paragraph

PostPosted: Sat Nov 03, 2012 7:41 pm
by jason
Same behaviour with both FOP 1.0 and FOP 1.1.

Reported as https://issues.apache.org/bugzilla/show ... i?id=54094