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.

Thu Jul 07, 2022 4:15 pm

Hello support team,

We are trying to create docx file from pdf
We have used following code

Code: Select all
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(pdfFilePath);
doc.SaveToFile(docxFilePath, FileFormat.DOCX);



Problem is, in the resultant docx file, fonts are different, even some text overlaps,
some gray backgound is also added.

I have attached simple pdf and converted docx file in the attachment

Please guide us in a correct way, so we can get the docx file exactly like pdf.

victoria07indpro
 
Posts: 9
Joined: Wed Jul 06, 2022 1:57 pm

Thu Jul 07, 2022 5:24 pm

Hello,

Did you try to convert in PS mode to see if you get better results?

Code: Select all
//Create a PdfDocument object
            PdfDocument doc = new PdfDocument();

            //Load a sample PDF document
            doc.LoadFromFile(@"C:\Users\Administrator\Desktop\sample.pdf");

            //Use PS mode for converting PDF to Word, and set the recognition mode to flow
            doc.ConvertOptions.SetPdfToDocOptions(true, true);

            //Convert PDF to Docx and save it to a specified path
            doc.SaveToFile("ToDocx.docx", FileFormat.DOCX);


https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Conversion/How-to-convert-PDF-to-Doc-in-C-VB.NET.html

sbgmedia
 
Posts: 6
Joined: Sun Jun 26, 2022 1:05 pm

Fri Jul 08, 2022 8:05 am

Hi,

Thank you for your inquiry.
After converting your PDF to Word, I noticed that some font names have suffix in Word, such as Arialregular-uxryk and TimesNewRomanBold-VNQHO. I posted this behavior to our dev team for further investigation, the problem ticket is SPIREPDF-5334. Once there is any update, I will inform you. Apologize for the inconvenience.
In addition, I didn't reproduce the overlapped text and gray background in Word. Here I attached my generated Word for your reference. If you were not using our latest Spire.PDF(Spire.PDF Pack(Hot Fix) Version:8.7.2), I would suggest you give the latest one a try. If these two problems still exist, please provide your test environment(win 10,64 bit) and application type( Console App, .NET Framework 4.6) for further investigation. Thanks in advance.

Sincerely,
Kylie
E-iceblue support team
User avatar

kylie.tian
 
Posts: 412
Joined: Mon Mar 07, 2022 2:30 am

Fri Jul 08, 2022 9:48 am

Thanks for the reply sbgmedia and Kylie

@sbgmedia : I tried using PS mode, but there was no difference

@Kylie : as you suggested I did upgrade version to 8.7.2
No difference there.

I am attaching the screenshot of the docx file which i converted from a PDF.
NOTE: was not able to attach actual document due to the size restrictions
Here u can see gray background. And i am very much sure that i removed anything that had gray color.
Overlapping text is not consistent, Sometime i see that and some times no.

No able to understand.

Here are the details for your ref

Test environment : Linux
Application type : web App, .NET Core

victoria07indpro
 
Posts: 9
Joined: Wed Jul 06, 2022 1:57 pm

Fri Jul 08, 2022 10:36 am

Hi,

Thank you for your reply.
Please upload your file via Google Drive and share the download link. You can attach the link here or send it to us via email (support@e-iceblue.com). Thank you in advance. I will give you feedback after the test.

Sincerely,
Kylie
E-iceblue support team
User avatar

kylie.tian
 
Posts: 412
Joined: Mon Mar 07, 2022 2:30 am

Fri Jul 08, 2022 11:10 am

Hi Kylie,

Have sent the google link via mail.

Thank you

victoria07indpro
 
Posts: 9
Joined: Wed Jul 06, 2022 1:57 pm

Mon Jul 11, 2022 6:56 am

Hi,

Thank you for your sharing and sorry for the late reply due to weekend.
I reproduced your two problems(overlapped text and gray background) and our dev team will investigate them. I will let you know as soon as the problems are resolved or there is any update. Sorry for the inconvenience.

Sincerely,
Kylie
E-iceblue support team
User avatar

kylie.tian
 
Posts: 412
Joined: Mon Mar 07, 2022 2:30 am

Mon Jul 11, 2022 10:31 am

Hi Kylie,

Thank you very much for your reply.

May I know the progress of the fix ?
We really want to go ahead with Spire.PDF.
we just want to be sure that we get what we are expecting from spire.

Please keep me updated with the progress of the fix.

Thank you in advance
Regards
Victoria

victoria07indpro
 
Posts: 9
Joined: Wed Jul 06, 2022 1:57 pm

Tue Jul 12, 2022 7:21 am

Hi Victoria,

Sorry currently there is no progress about the issues SPIREPDF-5334. Our dev team need time to parse your document and locate the cause of the issues. Please spare us more time, once there is any good news, I will inform you. Thanks for your understanding.

Sincerely,
Kylie
E-iceblue support team
User avatar

kylie.tian
 
Posts: 412
Joined: Mon Mar 07, 2022 2:30 am

Return to Spire.PDF