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.

Thu Nov 11, 2021 6:59 pm

While trying to convert a DOCX to PDF, there are certain fields we are replacing and then we are creating the final PDF.
There is a random text which gets added as "khbdv" below the header. If the same docx document is saved directly, we cant see the same characters.
I have added the parameter list as UsePSCoversion = true, IsEmbeddedAllFonts = true.

Language: C#, Nuget Package version: 9.9.7, C# version: 7.3, .Net Framework 4.7.2

sumanpadhy
 
Posts: 4
Joined: Thu Nov 11, 2021 6:37 pm

Fri Nov 12, 2021 7:20 am

Hello,

Thank you for your inquiry.
I did an initial test but didn't reproduce your issue. I suggest you first try again with the latest version(Spire.Doc Pack(hot fix) Version:9.11.6). If the problem still exists after trying, to help us have further investigation, please provide your sample Word file and your test environment, such as OS info (E.g. Windows 7, 64-bit) and region setting (E.g. China, Chinese). You could attach them here or send them to us via email (support@e-iceblue.com). Thanks in advance.

Sincerely,
Annika
E-iceblue support team
User avatar

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

Mon Nov 15, 2021 6:10 am

Same issue still persists with the shared nuget package when the document is saved as a PDF. This issue is not seen when we try saving as a word document.

sumanpadhy
 
Posts: 4
Joined: Thu Nov 11, 2021 6:37 pm

Mon Nov 15, 2021 7:24 am

Hi,

Thank you for your feedback.
To help us investigate your issue more accurately, please provide your sample Word file and complete test code. Don't worry, we will absolutely keep your document confidential and will not use it for other purpose. You could attach them here or send us via email (support@e-iceblue.com). Thanks in advance.

Sincerely,
Annika
E-iceblue support team
User avatar

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

Mon Nov 15, 2021 8:30 am

Shared the documents over the mentioned mail.
Spire.doc.zip

Code: Select all
**Note input param modified
<PackageReference Include="FreeSpire.Doc" Version="9.9.7" />

 public async Task<Stream> GenerateInvoiceDoc(param)            
 {
            document.LoadFromFile(localPath);
                ToPdfParameterList list = new ToPdfParameterList() { UsePSCoversion = true, IsEmbeddedAllFonts = true };
                document.SaveToFile("test1.pdf", FileFormat.PDF);
               
                var stream = new MemoryStream();               
                document.SaveToStream(stream, list);
                document.SaveToFile("test.docx", FileFormat.Docx);
                stream.Position = 0;
                return stream;
 }

sumanpadhy
 
Posts: 4
Joined: Thu Nov 11, 2021 6:37 pm

Mon Nov 15, 2021 9:40 am

Hello,

Thank you for your sharing.
I tested your case and did reproduce your issue. After investigation, I found that the new engine method can solve this issue. The sample code is as follows.
Code: Select all
 < PackageReference Include = "Spire.Doc" Version = "9.11.6" />
 public async Task<Stream> GenerateInvoiceDoc(param)
 {
     document.LoadFromFile(localPath);
     //do something with the content
     ...
     // use the new engine method
     document.UseNewEngine = true;
     document.SaveToFile("test.pdf", FileFormat.PDF);
 }

Sincerely,
Annika
E-iceblue support team
User avatar

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

Mon Nov 15, 2021 11:56 am

Thank you for sharing the response. However with the UseNewEngine set as true, we have a new page introduced which says :
"Free version converting word documents to PDF files, you can only get the first 3 page of PDF file.
Upgrade to Commercial Edition of Spire.Doc <http://www.e-iceblue.com/Introduce/word-for-net-introduce.html>"

sumanpadhy
 
Posts: 4
Joined: Thu Nov 11, 2021 6:37 pm

Tue Nov 16, 2021 1:32 am

Hello,

Thank you for your feedback.
Kindly note that the new engine method is a new method in the commercial version of Spire.Doc. If you use the free version, the behavior you mentioned will appear. So please remove all the DLLs related to Free Spire.Doc in the project, and then install Spire.Doc Pack (hot fix) Version:9.11.6 from Nuget Manager.

Sincerely,
Annika
E-iceblue support team
User avatar

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

Return to Spire.Doc