Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Tue Jul 25, 2023 9:13 am

Hello support team,

we encounter some issues concerning page breaks at unwanted positions when saving a document to a pdf file. While Microsoft Word keeps the page breaks in the pdf file at the same positions as in the original document file, Spire.Doc for Java doesn't keep the page breaks when the document file is saved to pdf using the following code:

Code: Select all
Document document = new Document("Test.docx");
document.saveToFile("Test_with_SpireDoc.pdf", FileFormat.PDF);


Please find attached the following files:
  • Test.docx - the original document file
  • Test_with_Word.pdf - the pdf file that was created when saving the original document file to pdf using Microsoft Word
  • Test_with_SpireDoc.pdf - the pdf file that was created when saving the original document file to pdf using Spire.Doc for Java 11.7.0

Am I missing some important settings to keep the page breaks on their original positions?

Kind regards,
Marcus

mgattinger
 
Posts: 65
Joined: Fri May 21, 2021 9:03 am

Tue Jul 25, 2023 10:09 am

Hi Marcus,

Thanks for your feedback.
After testing ,I have reproduced the issue you mentioned, starting from the third page, there are some issues with the format of the result document, I have recorded them into our issue tracking system with the ticket number SPIREDOC-9708,our developers will investigate and fix it. Sorry for the inconvenience caused, once the issue is fixed, I will inform you asap.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.Doc