Page 1 of 1
pdf output does not match word
Posted:
Thu Nov 10, 2011 8:33 am
by fachhoch
I tried pdf generation and never it created one similar to word , pdf is adding lot of minus signs, some places it removes the blank line .... etc.
does pdf works for all others? what is work around to make pdf right ?
Re: pdf output does not match word
Posted:
Thu Nov 10, 2011 9:09 am
by jason
You'll need to post your input docx (or preferably a simplified test case) and the resulting pdf.
"Lots of minus signs" doesn't sound normal...
Re: pdf output does not match word
Posted:
Thu Nov 10, 2011 9:33 am
by fachhoch
Re: pdf output does not match word
Posted:
Thu Nov 10, 2011 9:52 pm
by jason
The "dashes" actually look to be underlines, coming from an empty paragraph:
Using xml Syntax Highlighting
<w:p w:rsidRDefault="005A0D87" w:rsidP="005A0D87" w:rsidR="005A0D87" w:rsidRPr="00A73B79">
<w:pPr>
<w:rPr>
<w:b/>
<w:u w:val="single"/>
</w:rPr>
</w:pPr>
</w:p>
Parsed in 0.001 seconds, using
GeSHi 1.0.8.4
This is because in the case of an empty paragraph, Conversion.java is adding a space:
Using java Syntax Highlighting
// Handle empty case - want the block to be preserved!
if (n.
getChildNodes().
getLength()==0
) {
((Element)foBlockElement
).
setAttribute( "white-space-treatment",
"preserve");
foBlockElement.
setTextContent(" ");
Parsed in 0.015 seconds, using
GeSHi 1.0.8.4
Re: pdf output does not match word
Posted:
Fri Nov 11, 2011 2:24 am
by lucasfgc
Jason,
So, how to add a new line (blank one)?
Re: pdf output does not match word
Posted:
Fri Nov 11, 2011 5:05 am
by fachhoch
Jasaon/Lucas,
any updates on this ? is this something whihc can fixed by overriding some method ?
Re: pdf output does not match word
Posted:
Fri Nov 11, 2011 9:46 am
by jason
You can work around this issue by removing the underline from the empty paragraphs in Word.
The correct fix will require a change to docx4j.