Free Support Forum - aspose.com

PDF headers/footers not the same as Word source doc

Hello,


we are generating a pdf file from a Word doc and the headers and footers do not appear the same in the pdf as in the doc.

On the first page of the pdf the header and footer are drawn almost correctly but on the second page header the document name (yahoo) is cut off and the line is cut off even more. The footer is cut so much that the page number doesn’t show.

In addition in the pdf, our section header (blue boxes) bottom border does not draw fully. I suspect it has something to do with the text drawn after as the thick bordered tables also do not have the bottom border drawn fully (thickness wise). Finally, the bordered screen shot appears to be slightly truncated on the right side so the border does not show.

Is this a problem with pdf generation or is there something we can do before outputting the Word doc as a pdf? As you will see, the source Word doc looks fine.

We are using Aspose.Words version 11.9.0.0 I have attached a zip file containing both Word and pdf documents.

Thanks in advance.


Hi David,


Thanks for your inquiry.
rwdtech:
On the first page of the pdf the header and footer are drawn almost correctly but on the second page header the document name (yahoo) is cut off and the line is cut off even more. The footer is cut so much that the page number doesn’t show.
Please use the latest version of Aspose.Words for .NET to get better results (Doc to Pdf conversion). However, I have logged this issue (header/footer cut off at the right side of page) as WORDSNET-7697 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.
rwdtech:
In addition in the pdf, our section header (blue boxes) bottom border does not draw fully. I suspect it has something to do with the text drawn after as the thick bordered tables also do not have the bottom border drawn fully (thickness wise). Finally, the bordered screen shot appears to be slightly truncated on the right side so the border does not show.
I have not found this issue while using latest version of Aspose.Words for .NET. Please check the output Pdf in attachment.

We apologize for your inconvenience.

Hello Tahir,


many thanks for your reply. I downloaded both version 11.10 and 11.11 of Aspose.Words and neither version made any difference to my pdf output. The right side of my images are still getting cut off. I have uploaded a zip file containing word and pdf docs that better illustrate my problem. Perhaps you could run the word doc through your pdf generation (hopefully it is 11.11) and see what the result is? If you look at the word doc and the corresponding pdf you will see that on page 3, there are numbers on the right side of the screenshot that are within the border but not part of the screenshot itself. These numbers are cut off in the pdf version.

In addition, using version 11.10 and 11.11 I came across another problem. In a part of our code we are calling Cell.RemoveChild(Cell.LastParagraph) and later on trying to access the DocumentBuilder.ParapgraphFormat This now results in a “Null Object Reference” exception. Logical if you consider what we have done but it did not do this in 11.9. From my testing, this change in behavior was introduced in 11.10. Could you possibly confirm that something was changed? Commenting out the RemoveChild() line doesn’t appear, so far, to make a difference to my output.

Thanks again for your help

Hi David,


Thanks for your inquiry. Regarding issue (right side of text is cut off in pdf file), I had already logged this issue as WORDSNET-7697 in our issue tracking system. You will be notified via this forum thread once this issue is resolved.
rwdtech:
In addition, using version 11.10 and 11.11 I came across another problem. In a part of our code we are calling Cell.RemoveChild(Cell.LastParagraph) and later on trying to access the DocumentBuilder.ParapgraphFormat This now results in a “Null Object Reference” exception. Logical if you consider what we have done but it did not do this in 11.9. From my testing, this change in behavior was introduced in 11.10. Could you possibly confirm that something was changed? Commenting out the RemoveChild() line doesn’t appear, so far, to make a difference to my output.
Could you please attach your input Word document for this issue (DocumentBuilder.ParapgraphFormat throws exception) here along with code for testing? I will investigate the issue on my side and provide you more information.

The issues you have found earlier (filed as WORDSNET-7697) have been fixed in this Aspose.Words for .NET 18.10 update and this Aspose.Words for Java 18.10 update.