Create JPG thumbnails

Discussions about PDF management.
Post Reply
moakley
Posts: 6
Joined: Wed May 14, 2014 3:34 pm

Create JPG thumbnails

Post by moakley » Tue Jun 17, 2014 9:26 pm

I am trying to create a JPG thumbnail for each page of a PDF. For the attached PDF the first 5 pages are empty. Page 6 has what I would expect. For many other PDFs the following code produces what I need. Mostly I get good results. Can you tell me how I can get consistent results.

gdPictureStatus = gdPicturePDF.LoadFromFile("C:\\Temp\\3396546.pdf", false);
if (gdPictureStatus == GdPictureStatus.OK)
{
pageCount = gdPicturePDF.GetPageCount();

for (int page = 1; page <= pageCount; page++)
{
gdPicturePDF.SelectPage(page);
currentPageId = gdPicturePDF.GetCurrentPage();

tmpTNFilename = "C:\\Temp\\3396546_TN000" + page + ".jpg";

currentPageId = gdPicturePDF.RenderPageToGdPictureImageEx(300, true);

thumbnailId = gdPictureImaging.CreateThumbnail(currentPageId, 77, 100);

gdPictureImaging.SaveAsJPEG(thumbnailId, tmpTNFilename);

gdPictureImaging.ReleaseGdPictureImage(currentPageId);
gdPictureImaging.ReleaseGdPictureImage(thumbnailId);

gdPictureImaging.Dispose();
}
}
Attachments
3396546.zip
(147.46 KiB) Downloaded 304 times

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Create JPG thumbnails

Post by Loïc » Sun Jun 22, 2014 2:25 pm

Hello,

We've replied to your duplicated request into our helpdesk mentioning that problem will be fixed in our next minor release.

With best regards,

Loïc Carrère

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests