Print Page | Close Window

Create Thumbnails

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2629
Printed Date: 29 Sep 24 at 1:21AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Create Thumbnails
Posted By: moakley
Subject: Create Thumbnails
Date 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?



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk