Print Page | Close Window

Issue with RenderPageToFile

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=3187
Printed Date: 18 May 26 at 7:09AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Issue with RenderPageToFile
Posted By: chadnewman
Subject: Issue with RenderPageToFile
Date Posted: 09 Oct 15 at 5:11PM
I'm using RenderPagetoFile to convert a PDF to a Tiff image.  The method returns a success, but only creates a 1K Tiff that is not usable.  Below is a link for the PDF I'm trying to use.

https://onedrive.live.com/redir?resid=D00E601EE3131C52!25556&authkey=!AChRq_7PfDCm5Jk&ithint=file%2cpdf

Here is the code I'm using in Visual FoxPro

dplloadfromfile(ninstanceid,cimportname,"")
nfilehandle = dpldaopenfile(ninstanceid,cimportname,"")
npagecount = dpldagetpagecount(ninstanceid,nfilehandle)
nrendersuccess = dplrenderdocumenttofile(ninstanceid,300,1,npagecount,7,tcfilename)

Thanks,

Chad Newman



Replies:
Posted By: Ingo
Date Posted: 17 Oct 15 at 7:59PM
Hi Chad,

it works fine for me.
I'm wondering why you want to use 300 dpi?
The original embedded image has 7198 x 4790 pixels.
With the (for pdf normal) 72 dpi you're getting a 2592 x 1725 pixels tiff-file with 1.13 mb.
With 300 dpi you're getting a 10798 x 7185 pixels tiff-file with 12.3 mb.
So you should try something between these two dpi-values.
Here is my code:
targetfile := target + ExtractFileName(Edit1.Text) + '-72.tif';
QP.RenderDocumentToFile(72, 1, QP.PageCount, 7, targetfile);
targetfile := target + ExtractFileName(Edit1.Text) + '-300.tif';
QP.RenderDocumentToFile(300, 1, QP.PageCount, 7, targetfile);

If you want to get the best quality image you should try other functions.
Plans like yours are embedded as original image-files into pdf-documents.
So you should grab the images out of the pdf-document.
You can use for this job (in the same order):
QP.SelectPage()
QP.GetPageImageList()
QP.GetImageListCount()
QP.GetImageListItemIntProperty() // <-- to get the original filetype
QP.SaveImageListItemDataToFile()

Cheers and welcome here,
Ingo



-------------
Cheers,
Ingo



Posted By: chadnewman
Date Posted: 20 Oct 15 at 2:55PM
Ingo,
Thank you very much for your reply.

I will review what you have posted and give it a try.



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