We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Line spacing problem with Export for PDF

I’m having several problems with converting a word document to pdf, however this problem seems to stem from the Aspose.Words Export for PDF rather than with the PDF rendering.
I have attached sample files.
I’ve created a simple word document with 60 lines of text Linexx ----- (xx is the line number) the Font is 10pt, and the Paragraph format Line Spacing is single (this is effectively 12pt). The Exported pdf xml file states that the lineSpacing is 1.5 (pt), clearly 12pt - 10pt is 2pt. The effect of this is that while I only get 58 lines on a page in Word, I get 60 on a page in the PDF document, if I manually edit the xml to set the lineSpacing to 2pt, I get the correct number of lines on a page.
Our client is very particular about the format of the PDF and Word documents we produce. On the surface this seems like a fairly straight forward bug.
I’ve provided a zip attachment containing the original word document, the xml produced, and the pdf prodcued. I’ve also provided a hand edited xml document, and the pdf produced from that.

Thank you for your interest in our products and for the investigation you performed.
I’ve looked the materials and can agree with you. From the first sight this looks like a bug. But I have to spend some time investigating why it is done this way. As I wrote many times in this forum getting 100% exact PDF in technically impossible due to many reasons. Maybe trying to fix this issue could break something else unexpectedly. So it is not a five-minute question. I’ll provide more information when I get full picture.

I’ve performed some more experiments with this issue. And we can suggest nothing without changing font in the document.
As I already noted things are not so easy. We opened your document on two machines. On the first one under MS Word 2003 it shows 58 lines on the page and on the second with Word 2007 – 40 lines. Even if MS Word has difficulties with this font what can we do? When I changed the font to something more popular, such as “Arial” and “Times New Roman” I obtained steadily 60 lines. See the attachment.
You are using font “TradeGothic LT” in the document. Some fonts show such strange behavior with spacing. So the best we can do is not using them at all. You can find some font with similar typeface. Of course you can patch our intermediate XML manually. But in this case results could be unpredictable and I won’t recommend this.

Many thanks for the quick reply. However we consistently get 58 lines in both MS Word 2003, and MS Word 2007. Can you check that the machine running 2007 has the font installed, and that it is in normal mode (i.e. not reading mode), or if possible try another machine with Word 2007 installed, we haven’t seen this issue between the two versions of Word.

Thanks in advance.