We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

pdfConverter not work well in multiple theads

hi, I have a lot of pdf need to conver to image. I use the pdfConverter.GetNextImage method in multiple theads, but the performance is more worse than single thead. why? not support?


Thanks for using our products.

The conversion of PDF to Images depends upon the structure and complexity of source PDF file and due to the input PDF file which you are using, the conversion process might be taking longer duration. Can you please share the source PDF file so that we can test the scenario at our end. We are sorry for this inconvenience.

PS, Aspose.Pdf for .NET is supported in multi-threaded environment but a single PDF file cannot be used in multiple threads. So as per your requirement, you need to load one PDF file in individual thread.

//get 10 pdf file

string[] files = Directory.GetFiles(workFolder, “*.pdf”);

//case 1: sigle thread will take about 7s

foreach (var file in files)




//case 2: multiple thread will take 9s


Parallel.ForEach<string>(files, new Action<string>(AsposeToImage));

//case 3: also 9s

files.ToList().ForEach(s =>


Thread t = new Thread(new ParameterizedThreadStart(AsposeToImage));





AsposeToImage(object file)



PdfConverter pdfConverter = new PdfConverter();



pdfConverter.StartPage = 1;

pdfConverter.Resolution = 96;

if (pdfConverter.HasNextImage())


pdfConverter.GetNextImage(workFolder +

Path.GetFileNameWithoutExtension(file.ToString()) + ".png");




Thank you for your reply. please review my code and where is the problem?


Thanks for sharing the code and resource files.

have tested the scenario and I am able to reproduce the same performance related issue while using the product in multi-threaded environment. For the
sake of correction, I have logged it in our issue tracking system as
will investigate this issue in details and will keep you updated on the status
of a correction.

We apologize for your inconvenience.