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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Issue with RenderPageToFile
  FAQ FAQ  Forum Search   Register Register  Login Login

Issue with RenderPageToFile

 Post Reply Post Reply
Author
Message
chadnewman View Drop Down
Beginner
Beginner


Joined: 09 Oct 15
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote chadnewman Quote  Post ReplyReply Direct Link To This Post Topic: Issue with RenderPageToFile
    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
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3530
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
chadnewman View Drop Down
Beginner
Beginner


Joined: 09 Oct 15
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote chadnewman Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store