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.

Mon Jun 01, 2020 12:24 pm

Hi Team,

We have a application where users will be uploading multiple documents. The document may vary from 10MB file to 30MB.

Each document i am reading and then converting the document to PDF and saving in a location. Assume that i have 20 files.

When i loop and read the document and start converting documents, Few documents are taking more time than expected almost 2 - 3 mns. Assume mean time if another user upload more 10 documents and they it starts conversion process and this goes on....

Now my question is How is the DLL is handling these many conversions. Because as per my Understanding when i checked when a document conversion is taking long time and mean time another conversions are added to Queue and its effecting my RAM and conversion is taking more time than it is supposed. After some time when i checked my RAM Usage, it is using more Ram Usage and after sometime it is completely slowing the conversion process until i stop all the conversions and start again.

This is my major issue and not sure how DLL is handing large files conversions.

Can you please help me to resolve this issues as this will be my major blocker if i go live and my customers start using the application.

Please let me know if you need more information.

Regards,
Ravi

ravikumarh99
 
Posts: 10
Joined: Thu May 14, 2020 2:58 am

Tue Jun 02, 2020 8:12 am

Hello,

Thanks for your inquiry.
When using a single thread to convert multiple documents in a loop, our product will only perform the next conversion after the current conversion process ends. Are you using multiple threads?
And I tried to convert a Word document about 30MB in size with the latest Spire.Doc Pack(hot fix) Version:8.5.8, it took about 56 seconds. If you are using an older version, I suggest you download the latest version and try again.
Besides, there is another PS conversion method. Generally, it takes less time than normal methods. Below is the corresponding code. You can also try it.
Code: Select all
    Document doc = new Document();
    doc.LoadFromFile(inputPath);
    ToPdfParameterList tpl = new ToPdfParameterList
    {
        UsePSCoversion = true
    };
    doc.SaveToFile(outputPath, tpl);


If it still take a long time after trying, to help us better investigate your issue, please provide us with your full test code and some sample Word files. You could upload your Word files to the DropBox or OneDrive and then send the download link to us(support@e-iceblue.com) via email. Thanks in advance.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Wed Jun 03, 2020 4:53 am

Hi Team,

I have recently purchased the DLL(In April Month), Do you want me to still run the Patch file(Spire.Doc Pack(hot fix) Version:8.5.8) you shared. Please confirm?

We have a API, Where user will upload the documents, Whenever we have a request the API will check the document and start converting. In meantime if we have another request we again it will start Converting the Document and it goes on. If assuming that we have multiple requests then how will the DLL Performs.

We are using multiple threads(Internally assuming multiple API Requests). As there will be series of users uploading the documents. We will have multiple threads running.

Can you please confirm how it works?

Regards,
Ravi

ravikumarh99
 
Posts: 10
Joined: Thu May 14, 2020 2:58 am

Wed Jun 03, 2020 9:35 am

Hello,

Thanks for your feedback.
If you're using a relatively old version, I'd suggest you test your case with the latest version, as the performance of the new version may be enhanced.

When using multiple threads to convert multiple large files at the same time, it usually consumes a lot of memory, which may affect the conversion speed. I'm afraid this requires the server's memory is large enough so that it doesn't have a large impact on the conversion speed. Meanwhile, I recommend you invoke the "Document.Dispose()" method to release resources after the conversion process is completed.

Besides, have you tried the PS conversion method? How much time does the it take? If conversion speed is not significantly improved, provide us with your runnable project and some sample Word files to help us further investigate your issue. Thanks in advance.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Thu Jun 04, 2020 9:56 pm

Hi Team,

We have followed the steps and upgraded the DLL, But we are still facing the issues. I have attached the code which we are using. Can you please check and let me know your suggestions to work the application smoothly. We did not use PS Conversion as when we use this in the output PDF, we have square displayed if any of the font not supported.

We have a major scenario where if we have a large file and if it is taking long time to execute and mean time we have another request with 30mb of file it is getting on Queue and because of this i see RAM increase to 97 - 99% and slowing my complete process. Can you please suggest if the document conversion is taking long time to execute is there a way to kill that instance.

I have attached the document with code with documents. Can you please check and suggest us what better changes we can do to improve the performance.

Also can you please suggest what is the best configuration of RAM we need to use in server when we have around 1000 Documents to be processed.

Waiting for your reply.

Regards,
Ravi

ravikumarh99
 
Posts: 10
Joined: Thu May 14, 2020 2:58 am

Fri Jun 05, 2020 7:08 am

Hello,

Thanks for your feedback.
For the sample file your provided, I tested the normal method, it took around 147 seconds. And when using the PS method, it took around 103 seconds. In fact, the PS method performs better than the normal method, and we prefer to recommend you to use the PS method. Regarding the font display issue using the PS conversion method, please provide us with the problematic documents and we will do further investigation and fixing.

Our Spire.Doc cannot internally determine the total time spent in the conversion process and kill the instances that take too long. I suggest you set a time limit for the conversion process. If the conversion process is not completed after the set time, then terminate the process.

And as for the configuration of RAM you mentioned, for your situation, I'm afraid you need to ensure that your server memory is large enough and release the memory in time after the process ends. You could try to use the following code for garbage collection.
Code: Select all
    System.GC.Collect();
    System.GC.WaitForPendingFinalizers();


Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Fri Jun 05, 2020 7:14 pm

Hi Team,

We are facing issues while converting the Document to PDF with 2 column. When we have 2 column Images got stripped and also we have the text displayed on top of Image.

I have attached the document for the same. Can you please check and confirm?

below is the code we used.

dr.Sections[i].PageSetup.RestartPageNumbering = true;
dr.Sections[i].PageSetup.PageStartingNumber = 1;

dr.Sections[i].AddColumn(100f, 20f);
dr.Sections[i].MakeColumnsSameWidth();

int cols = dr.Sections[i].Columns.Count;
float colwidth = 0;
foreach (Spire.Doc.Column c in dr.Sections[i].Columns)
{
colwidth = c.Width;

}
RunSetcolWidth(dr, i, colwidth);

Regards,
Ravi D

ravikumarh99
 
Posts: 10
Joined: Thu May 14, 2020 2:58 am

Mon Jun 08, 2020 6:25 am

Hello,

Sorry for the late reply as weekend.
I tested your scenario and found the generated PDF file is not consistent with the Word file split into two columns, as shown in the attached screenshot. This issue has been logged into our bug tracking system with the ticket SPIREDOC-4604. If there is any update, we will let you know.
Apologize for the inconvenience caused.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.Doc