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

Free Support Forum - aspose.com

Header is one character to the left on the right hand side for .docx

Hi Aspose Team,

We have experienced the issue where the header is one character to the left on the right hand side in the pdf generated using .docx

Please find the attached "For Aspose Team" zip file which has the below sample files.

1. Test_Diff.doc
2. Test_Diff.docx
3. Test.xml
4. Test_doc.pdf
5. Test_docx.pdf

Test_Diff.doc is a doc templete which is merged with Test.xml to produce Test_doc.pdf

Test_Diff.docx is a docx templete which is merged with Test.xml to produce Test_docx.pdf

When both the pdf are compared, the header is one character to the left on the right hand side for .docx

Thanks,

Subhashini

Hi Subhashini,


Thanks for your inquiry. This is an expected behavior. You can confirm it by saving ‘Test_Diff.doc’ to DOCX format using MS Word 2013. Aspose.Words mimics the behavior of MS Word 2013. If we can help you with anything else, please feel free to ask.

Best regards,

Hi Aspose Team,

Can you please check this behaviour in Word 2010.

In Word 2010, there is no difference in doc and docx files, but the above issue exists in pdf files.

Thanks,

Subhashini

Hi Subhashini,


Thanks for your inquiry. You can fix this issue by using the following code:

Document doc = new Document(MyDir + @“Test_Diff.doc”);

doc.CompatibilityOptions.OptimizeFor(MsWordVersion.Word2010);

...


I hope, this helps.

Best regards,