Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
Create Thumbnails |
Post Reply |
Author | |
moakley
Beginner Joined: 23 Oct 12 Status: Offline Points: 9 |
Post Options
Thanks(0)
Posted: 30 Apr 13 at 2:06PM |
I would like to create thumbnails for each page in a PDF. These thumbnails need to be JPEG and I would expect them to be 2 - 8 kb is size. See the following code for the things that I have tried.
int DocumentID = qp.LoadFromFile(fullFileName, ""); int iNumPages = qp.PageCount(); for (int i = 1; i <= iNumPages; i++) { tmpTNFilename = Set thumbnail filename for this page qp.SelectPage(i); qp.NormalizePage(0); // Gave me just part of the lower left corner //sizeDouble = QPDFUtilities.GetImageSize(qp, thumbnailData); //qp.SetPageDimensions(sizeDouble.WidthDouble, sizeDouble.HeightDouble); // When opened in a viewer still gives me a full page and the file size is too large //qp.SetPageThumbnail(); // When opened in a viewer still gives me a full page and the file size is too large scale = QPDFUtilities.GetImageScale(qp, thumbnailData); qp.SetScale(scale); qp.RenderPageToFile(96, i, 1, tmpTNFilename); thumbnailData.ThumbnailPaths.Add(tmpTNFilename); } qp.RemoveDocument(DocumentID); So what I am seeing is the resulting file size is too large and the image when displayed in a viewer is still a full page. Recommendations as to how I can use your available API to achieve the small file size. Or should I render each page to a JPEG and then just use .Nets System.Drawing.Image to create the thumbnails?
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store