Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Wed Feb 23, 2022 11:40 pm

I'm using Spire.PDF free to convert docx to pdf and send to browser. I'm using Windows 11 OS locally and Ubuntu on the server. The problem is:

Locally the text is perfectly aligned and the output pdf fits into 1 pdf page. However, on the server there is newline breaks between text blocks, which causes the text to span to 2 pages.

mzhadigerov
 
Posts: 1
Joined: Wed Feb 23, 2022 11:29 pm

Thu Feb 24, 2022 5:55 am

Hello,

Thank you for your inquiry.
Please note that converting docx to PDF is a Spire.Doc feature. I tested with Free Spire.Doc for .NET Version:10.2 and Spire.Doc Pack Version:10.1 respectively, but none of them reproduced the issue you mentioned. In addition, our Spire.Doc supports the following two methods to convert docx to PDF.
1) the PS method:
Code: Select all
Document document = new Document();
document.LoadFromFile("input.docx");
ToPdfParameterList ps = new ToPdfParameterList();
ps.UsePSCoversion = true;
document.SaveToFile("result2.pdf",ps);

2) the New engine method:
Code: Select all
Document document = new Document();
document.LoadFromFile("input.docx");
document.UseNewEngine = true;
document.SaveToFile("result2.pdf",FileFormat.PDF);

Please try the above two methods first. If the issue still exists after trying, please provide the following information for us to investigate. You could attach them here or send them to us via email ([email protected]). Thanks in advance.
1) Your input Word file.
2) Your complete test project.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Thu Mar 03, 2022 8:33 am

Hello,

Hope you are doing well!
How is your issue going? Did the code we provided work for you? Any feedback will be greatly appreciated.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.PDF