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.

Wed Oct 22, 2014 6:10 pm

Hi,

I'm trying to print multiple PDF files using a multi-threaded service, using this code :

Code: Select all
            using (PdfDocument doc = new PdfDocument())
            {
                doc.LoadFromFile(pdf_file_name);
                doc.PrintDocument.Print();   
            }


But it keeps giving me an error on doc.PrintDocument.Print(). The error is System.ArgumentException in mscorlib.dll "An element with the same key already exists".

If I do it one thread at a time, it works just fine. Does it means that this part (pdf file printing) isn't thread-safe?

gumby
 
Posts: 21
Joined: Tue Jan 28, 2014 8:25 pm

Thu Oct 23, 2014 2:07 am

Hi,

Thanks for your inquiry.
Our product is not thread-safe while printing pdf.
If you have any questions, welcome to get it back.

Best Regards
Lisa
E-iceblue support team
User avatar

lisa.chen
 
Posts: 21
Joined: Thu Mar 20, 2014 2:31 am

Return to Spire.PDF