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

Free Support Forum - aspose.com

Saving pdf doc from word

Hi,


I am attempting to save a word document to pdf. Below is the code I use to do so
ApplyLicence();
Aspose.Words.Document doc = new Aspose.Words.Document(fileName);
Aspose.Words.Saving.PdfSaveOptions opt = new Aspose.Words.Saving.PdfSaveOptions();
opt.SaveFormat = Aspose.Words.SaveFormat.Pdf;
doc.UpdateTableLayout();
doc.UpdateFields();
doc.Save(fileName, opt);
When the pdf is created, the format has changed for one of the paragraphs.

Please see attachements. “Shot 1” is of the word doc being loaded. “Shot 2” is the pdf output

Hi Aaron,


Thanks for your inquiry. I have opened the shared Docx file in MS Word 2010 and 2013 and have noticed that MS Word loads the contents as shown in your shot 2.JPG. Please see attached image for detail.

However, I have also noticed that MS Word 2007 loads the contents as shown in shot 1.JPG and Aspose.Words does not generate the same output. I have logged this issue as WORDSNET-8765 in our issue tracking system. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi Aaron,


Regarding WORDSNET-8765, it is to update you that our development team has completed the analysis of this issue and has come to a conclusion that they won’t be able to implement the fix to your issue. Most likely, your issue will be closed with ‘‘Won’t Fix’’ resolution.

If you open your document into MS Word 2010 and 2013, the MS Word loads the contents as shown in shot 2.JPG. I am quoting developer’s comment here for your reference:

This issue is most likely caused by different font metrics. You can see that Word 2007 text is not anti-aliased whereas later versions are. It could be that Word 2007 uses “grid fit” setting for rendering instead.

The subject line has paragraph break at the end. In Word 2007 due to metrics differences word “effective” managed to stay on the line and then it’s followed by paragraph break which wraps the remaining text to the next line. In later versions of Word this word doesn’t fit into the line and since it’s followed by paragraph break remaining words are flowed to the next line.

In theory Word 2007 may condense 2 leading spaces before words “Coverage above the” to fit text on the line. In either case Aspose.Words can do nothing to fix that as it uses font metrics directly and doesn’t use Windows native APIs to compute font metrics.