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 Mar 25, 2019 3:28 am

I am trying to improve the performance of the conversion of word documents to PDF. Currently on a single thread it takes about 3 seconds to convert a document.

The trouble is I will have over 60,000 files to convert in a day which is over 50 hours to process. I have tried multi threading the solution but it seems like Spire.Doc is not able to handle this as it still only does about 20 per minute. Do you know if Spire.Doc can process multiple threads at once? I would ideally like it to run 16 threads at once and get the time down to 3 hours or so.

Thanks,

Craig

crichardson@mmcnz.co.nz
 
Posts: 9
Joined: Fri Aug 24, 2018 1:32 am

Mon Mar 25, 2019 10:36 am

Hello,

Thanks for your inquiry.
Our Spire.Doc provides PS method (see below code) which is Thread Safe to convert Word to PDF. However, if using this method to do conversion in your multiple threads, it would cost more time than single thread, that's because the internal mechanism of PS method goes against with multiple threads. The question has been logged into our bug tracking system. I have to say the question involves many modules, I'm afraid it can't be resolved in a short time. If there is any significant progress, we will inform you immediately. Sorry for the inconvenience caused.
Code: Select all
Document doc = new Document();
doc.LoadFromFile(filename);
ToPdfParameterList topdfparams = new ToPdfParameterList();
topdfparams.UsePSCoversion = true;
doc.SaveToFile(filename,topdfparams);

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Mon Mar 25, 2019 7:03 pm

OK so Spire.Doc is not thread safe. I tried the PS Conversion flag but it threw a lot of errors like the below:
System.InvalidOperationException: Cannot find table 'loca' in the font file.
at spr?.?(String A_0)
at spr?.?(spr? A_0, spr? A_1, Stream A_2)
at spr?.?(spr? A_0, spr? A_1, Stream A_2)
at spr?.?(Stream A_0)
at spr?.?(spr? A_0)
at spr?.?(spr? A_0)
at spr?.?(spr? A_0)
at spr♀.?(spr? A_0, spr? A_1)
at spr♀.?(spr? A_0, Boolean A_1)
at spr♀.?(spr? A_0)
at spr☺.?(spr? A_0)
at spr?.?(spr? A_0)
at spr?.?()
at spr?.?()
at spr?.?(spr? A_0, Stream A_1)
at spr?.?(Document A_0, Stream A_1, ToPdfParameterList A_2)
at Spire.Doc.Document.?(String A_0, ToPdfParameterList A_1)
at Spire.Doc.Document.SaveToFile(String fileName, ToPdfParameterList paramList)

crichardson@mmcnz.co.nz
 
Posts: 9
Joined: Fri Aug 24, 2018 1:32 am

Tue Mar 26, 2019 1:53 am

Hi,

Thanks for your feedback.
If you were using an old version, I would suggest that you download the latest one (Spire.Doc Pack(hot fix) Version:7.3.10) to have a test. If the issue still happens on your side, please provide your files that caused issues, so that we can investigate them and look for solutions accordingly. You could send them to us via email (support@e-iceblue.com). Thanks in advance.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Wed Jun 12, 2019 7:29 am

Hello,

Thanks for your patient waiting.
We just released the Spire.Doc Pack(hot fix) Version:7.6.5, which contains the fixes of the previous issue that the PS method in multiple threads took more time than single thread. Please download the version and test your case. If there is any question, please feel free to write back.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Tue Jun 18, 2019 3:58 am

Hi,

Greetings from E-iceblue.
Has your issue been resolved?
Thanks in advance for your valuable feedback and time.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.Doc

cron