Word Document to PDF conversion in .NET with Aspose.Words REST API overlaps header with the body content

We use Aspose.Words to convert from DocX to PDF. However, given the attached* input file, the header seems to shift downwards. If the header is large, it would appear off the page. Here is the code from our unit test that shows the error.

Dim sDocFileName As String = IO.Path.Combine(Environment.CurrentDirectory, “DE47125.docx”)

Dim oDocoument As New Aspose.Words.Document(sDocFileName)
oDocoument.Save(sPdfFileName, SaveFormat.Pdf)
  • I’m also not sure how to attach a .docx file since the format for posting seems to have changed. Contact me at jgreiman@appliedsystems.com for the input file.

@greiman

Thanks for contacting Aspose Support.

You can attach input file by simply clicking on the Upload button. https://i.imgur.com/xhD43fK.png. You may need to zip the Docx file as Upload button only support jpg, jpeg, png, gif, zip and pdf extensions.

I have made this topic private, only you and Aspose Staff can read the topic content.

Here is the attached document. I had to zip it since you don’t allow docx for some reason.

DE47125.zip (69.5 KB)

@greiman

I failed to notice the issue. I have attached the PDF document that Aspose.Words for Cloud API generated.
DE47125.pdf (84.1 KB)

From your code, it looks like you are using Native APIs not REST/Cloud APIs. I would advise you to use the latest version of Aspose.Words for .NET.

Take a close look at the lines in the footer. There are two lines that span the whole page in the docx equidistant from the edges of the image. There’s also a bit of margin at the bottom.

In the PDF, there’s only one line that doesn’t span the whole page centered in the image. And there’s no margin between the image and the bottom of the page.

@greiman

I opened the Docx file both on Windows 10 and Mac OS X and discussed with a colleague as well, this is what footer looks on both OS:

Windows 10: https://i.imgur.com/lFvVkQ9.png
Mac OS X: https://i.imgur.com/jPCZaxv.png

Neither we able to find the two lines that span the whole page nor a margin between the image and the bottom of the page.

We would appreciate if you could share a screenshot that highlights the said objects clearly. Thank you.

P.S. We apologize if we are missing something obvious.

Image showing both footers attached.
I’m viewing the document in Word 2013 on Windows 10.

Footers.png (36.0 KB)

@greiman,

We are able to reproduce the issue at our end. The issue has been logged into our system with ID WORDSCLOUD-287 for further investigation by our Product team. We’ll update you here once there is some information or a fix version available in this regard.

@greiman

We are sorry for your inconvenience. The issue occurs because MS Word wraps header text around a floating table in the header, and Aspose.Words does not. This is a new feature. It requires additional investigation of Word behavior in regard to which floaters affect headers/footers and fix will need major re-work on Aspose.Words text wrapping around header/footer floaters. So the resolution for the your reported issue is postponed till further plans.

Thanks for your understanding and cooperation.