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 Sep 10, 2015 12:05 am

Hi There,

I am trying to save a 100 page word document to pdf using spire.doc. If I open the document in word and save to pdf it takes 11 sec. Using Spire.doc just hangs.

What can you do to speed this process up? It is causing major issues with out clients.

marcel@blake.net.nz
 
Posts: 2
Joined: Mon Feb 09, 2015 3:13 am

Thu Sep 10, 2015 1:58 am

Hello,

Thanks for your inquiry.
Could please provide your sample word document to us if convenient?
It would be helpful to replicate the issue and work out the solution for you ASAP.
If the information is confidential, you can send it to us ( Support@e-iceblue.com ) via email.

Best Regards,
Sweety
E-iceblue support team
User avatar

sweety1
 
Posts: 539
Joined: Wed Mar 11, 2015 1:14 am

Tue Sep 15, 2015 7:49 am

Hello,

How is the issue now?
If the issue still exists, could please provide your sample word document to us if convenient?
It would be helpful to replicate the issue and work out the solution for you ASAP.

Best Regards,
Sweety
E-iceblue support team
User avatar

sweety1
 
Posts: 539
Joined: Wed Mar 11, 2015 1:14 am

Wed Sep 23, 2015 12:30 pm

Hello,

I have the same issue.

I have a really big word document built with spire.doc.
It weighs about 65mo and has more than 620 pages.

The generation of the Word document is quite quick (about 1mn30) but the generation in pdf takes more than 15 minutes!

Is there something to do to speed up this generation ?

s.fardilha
 
Posts: 35
Joined: Tue Aug 11, 2015 9:20 am

Wed Sep 23, 2015 9:33 pm

Hi There,

I have just seen your reply so apologies for my late reply. Yes this is still an issue. I will email the file through to support shortly.

Thanks and Regards,

Tom

marcel@blake.net.nz
 
Posts: 2
Joined: Mon Feb 09, 2015 3:13 am

Thu Sep 24, 2015 3:57 am

Dear Tom,

Thanks for your providing. I have recreated your problem and posted it to our dev team. We will inform you when there is any update.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2767
Joined: Wed Jun 27, 2012 8:50 am

Thu Sep 24, 2015 4:02 am

Hello s.fardilha,

Thanks for your inquiry.
Our dev team will improve the conversion performance. Would you please provide us your test document? So that we can make sure new fix solves your issue. Thanks.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2767
Joined: Wed Jun 27, 2012 8:50 am

Thu Dec 24, 2015 3:51 am

Hi,

We did some improvement for Word to PDF conversion performance.
Welcome to download and test Spire.Doc Pack(hot fix) Version:5.5.211.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2767
Joined: Wed Jun 27, 2012 8:50 am

Thu Dec 24, 2015 9:04 am

Hello,

I tried the new ddls and I encounter each time an OverflowException...

Try to repeat several times the word file in attachment and then save it as a pdf and you should reproduce the problem...

s.fardilha
 
Posts: 35
Joined: Tue Aug 11, 2015 9:20 am

Fri Dec 25, 2015 1:41 am

Hi,

Thanks for your feedback.
I tested your word file with the following code, everything was ok.
Code: Select all
for (int i = 0; i < 10; i++)
            {
              Document doc = new Document();
              doc.LoadFromFile(inputWord);     
              doc.SaveToFile(outputPDF,FileFormat.PDF);
              doc.Dispose();
            }


Would you please tell us your system environment and share your testing code?

Thank you.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2767
Joined: Wed Jun 27, 2012 8:50 am

Mon Jan 04, 2016 9:19 am

Hi,

Indeed what you tried works.
But instead of saving in different files, append in a separated document and save it at the end.
Try something like this
Code: Select all
Document finalDoc = new Document();
for (int i = 0; i < 10; i++)
            {
              Document doc = new Document();
              doc.LoadFromFile(inputWord);     
              finalDoc.ImportContent(doc, false);
            }
finalDoc.SaveToFile(outputPDF,FileFormat.PDF);
finalDoc.Dispose();


When I make an assembled file, I encouter the error each time...

s.fardilha
 
Posts: 35
Joined: Tue Aug 11, 2015 9:20 am

Tue Jan 05, 2016 3:06 am

Hi,

Thanks for your providing.
Please close or dispose doc document after finishing importing content. I tested the following code with Spire.Doc Version:5.5.211 for .NET4.0, and there was no any error.
Code: Select all
 Document finalDoc = new Document();
            for (int i = 0; i < 10; i++)
            {
                Document doc = new Document();
                doc.LoadFromFile("template_test.docx");
                finalDoc.ImportContent(doc, false);
                doc.Close();
                doc.Dispose();
            }
            finalDoc.SaveToFile(outputPDF, FileFormat.PDF);
            finalDoc.Dispose();

If the issue still exists, please tell us your system environment for further investigation. Thank you.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2767
Joined: Wed Jun 27, 2012 8:50 am

Tue Jan 05, 2016 9:12 am

Hi,

I'm on .NET 3.5 and Spire.doc 5.5.211
And if I had to resume my code it would be like this (I added a portion of code in VB just to show you more details) :
Code: Select all
Document finalDoc = new Document();
for (int i = 0; i < 10; i++)
            {
              Document doc = new Document();
              doc.LoadFromFile(inputWord);     

              '''' Sorry it's in VB
              For Each s As Section In doc.Sections
                    t = New Table(doc)
                    r = t.AddRow()
                    c = r.AddCell()
                   
                    t.TableFormat.LayoutType = LayoutType.Fixed
                    t.PreferredWidth = New PreferredWidth(WidthType.Percentage, 100)
           
                    While s.Body.ChildObjects.Count > 0
                        Dim obj As DocumentObject = s.Body.ChildObjects(0)                                   

                        c.ChildObjects.Add(obj)
                    End While
                   
                    For Each p As Paragraph In c.Paragraphs
                        p.Format.KeepFollow = True
                    Next

                    s.Tables.Add(t)
                Next             
                '''' End of VB section

              finalDoc.ImportContent(doc, false);
            }
finalDoc.SaveToFile(outputPDF,FileFormat.PDF);
finalDoc.Dispose();

s.fardilha
 
Posts: 35
Joined: Tue Aug 11, 2015 9:20 am

Wed Jan 06, 2016 3:17 am

Hi,

I have reproduced your issue with new code you shared, sorry for the inconvenience that this issue brought. I have forwarded it to our dev team. We will inform you when it is resolved.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2767
Joined: Wed Jun 27, 2012 8:50 am

Mon Jan 11, 2016 11:16 am

OK.

Please let me know as soon as there is a fix for this issue.

s.fardilha
 
Posts: 35
Joined: Tue Aug 11, 2015 9:20 am

Return to Spire.Doc