Hi Aspose team,
we found an issue when converting a doc file to pdf with customized margins and containing tables. The document is somehow not rendered correctly in the output pdf.
However, if you first open the original document in MS Word and save it as docx (without that option to keep compatibility with earlier versions) and then run the code to adjust margins and save as pdf, the output is fine.
You can reproduce this with the following code:
var doc = new Document(@“S:\document.doc”);
var pageSetup = new DocumentBuilder(doc).PageSetup;
// 4 cm border
var margin = ConvertUtil.MillimeterToPoint(40);
pageSetup.TopMargin = margin;
pageSetup.RightMargin = margin;
pageSetup.BottomMargin = margin;
pageSetup.LeftMargin = margin;
I attached some files and outputs they generate:
original.doc -> The original doc file
original.pdf -> Output of original.doc generated with Aspose
originalWord.pdf -> Output of original doc manipulated (the margins) by MS Word and generated by MS Word (this is what we would expect Aspose output to look like)
saved_with_aspose.doc -> Original file manipulated (the margins) by Aspose and saved as doc with Aspose
saved_with_aspose.pdf -> Output of saved_with_aspose.doc generated with Aspose
converted_word_no_compatibility.docx -> Original file saved as docx with MS Word without keeping compatibility to earlier word versions
converted_word_no_compatibility.pdf -> Output of converted_word_no_compatibility.docx generated with Aspose
converted_word_with_compatibility.docx -> Original file saved as docx with MS Word with keeping compatibility to earlier word versions
converted_word_with_compatibility.pdf -> Output of converted_word_with_compatibility.docx generated with Aspose
I hope those files will help you.