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();
}
}
Create JPG thumbnails
Create JPG thumbnails
- Attachments
-
- 3396546.zip
- (147.46 KiB) Downloaded 304 times
Re: Create JPG thumbnails
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
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
Who is online
Users browsing this forum: No registered users and 1 guest