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.

Tue Apr 18, 2017 12:02 am

Hi iceblue support,

I am trying to convert attached file to images using following code.

doc.LoadFromFile(<PDF File>);

for (int p = 0; p < doc.Pages.Count; p++)
{
using (System.Drawing.Image img = doc.SaveAsImage(p))
{
img.Save(<Save Path Per Each Page>);
}
}


For this particular file doc.SaveAsImage(p) take vary long time (few minutes) to complete when other PDF files processed in milliseconds. Please let me know what causing this issue and is there any workaround.

Kind Regards,
Nuwan
Last edited by nuwan on Wed May 03, 2017 3:51 am, edited 1 time in total.

nuwan
 
Posts: 4
Joined: Wed Apr 12, 2017 5:50 am

Tue Apr 18, 2017 2:25 am

Dear nuwan,

Thanks for your inquiry.
I have tested the sample file with Spire.PDF Pack(Hot Fix) Version:3.9.27, and the process of the method doc.SaveAsImage(p) is very fast. Please try to use this version.
If there is any question, please let me know.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Tue Apr 18, 2017 3:02 am

Hi Betsy,

Thanks for the reply. I have tried the hot-fix but still having the same issue. The full code I am using is:

using (PdfDocument doc = new PdfDocument())
{
doc.LoadFromFile(@"C:\Tests\PDF\Image Conversion Test File.pdf");
for (int p = 0; p < doc.Pages.Count; p++)
{
using (System.Drawing.Image img = doc.SaveAsImage(p))
{
img.Save(string.Format(@"{0}\{1}_{2}.png", @"C:\Tests\PDF", "Image Conversion Test File", p));
}
}
}

Please let me know if I am missing anything. I have tested large number of files and this is the only one that I am having issues with.

Kind Regards,
Nuwan

nuwan
 
Posts: 4
Joined: Wed Apr 12, 2017 5:50 am

Tue Apr 18, 2017 3:17 am

Dear Nuwan,

Many thanks for the information and sorry for my mistake.
I have noticed the issue and posted it to our Dev team. Once there is any progress, we will inform you.
Sorry for inconvnience caused.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Tue May 02, 2017 8:46 am

Dear Nuwan,

Thanks for waiting.
Now the issue you mentioned has been fixed in Spire.PDF Pack(Hot Fix) Version:3.9.82, welcome to test it.
Looking forward to your feedback.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed May 03, 2017 3:49 am

I can confirm that the issue has been resolved in the new version.
Thanks for the quick response.
Nuwan

nuwan
 
Posts: 4
Joined: Wed Apr 12, 2017 5:50 am

Wed May 03, 2017 6:57 am

Dear Nuwan,

Thanks for your feedback.
Please feel free to contact us if you have any question.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.PDF