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!
Problem using QuickPDFRenderPageToFile with PNG |
Post Reply |
Author | |
AndrewC
Moderator Group Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
Posted: 11 Apr 11 at 9:08AM |
I am guessing the PDF developer of this PDF file made a wrong assumption and used 4544 x 4064 as the width and height. The image in this file is actually 4544 x 4064 pixels in size so I am pretty sure this is why the page dimensions are wrong and why the image is so big. The pageWidth/pageHeight are normally measured in points (72 points = 1 inch) and so the 4544 x 4064 needed to be scaled to points. ie. 1090 x 975. This image is 300 dpi so 4544 / 300 * 92 = 1090 and 4064 / 300 * 72 = 975. Using QPL to Render this file with the invalid page size consumed a 1 GB of memory. It did render ok on my 8GB machine. So some of the other ideas to render large files would be useful. Andrew.
|
|
darkv
Team Player Joined: 17 Jan 11 Status: Offline Points: 38 |
Post Options
Thanks(0)
|
Pedro,
Why don't you use a Windows DC to clip your image (or a part of), and then you "band" your image to reduce the size you have to deal with (as printer does when it process a big file) When you create the DC you can define the resolution for your device. My fear is memory consumption for such an image, but could be a workaround. please find below part of a vb.net code i used. Hope this helps Rgds Dim bmp As New Bitmap(iPw, iPH, System.Drawing.Imaging.PixelFormat.Format32bppArgb) gDisp = Graphics.FromImage(bmp) hDCd = gDisp.GetHdc ' lRtn = zPdf.RenderPageToDC(72, 1, hDCd) ' DPI settings Ps : dont forget to ".release" and ".dispose" variables ;-) |
|
PedroLamas
Beginner Joined: 07 Apr 11 Location: Portugal Status: Offline Points: 2 |
Post Options
Thanks(0)
|
Greetings Ingo,
First of all, let me thank you for your reply! :) I know the original page is 4544x4064, but I really need it at 150dpi because this page (and others a little less "noisy") will be used for OCR/ICR, and 150dpi is the minimum DPI's we need to get an accurate result! The problem is that if I output it as a BMP at 150dpi, it creates a file bigger that 200Mb, as for PNG the file will be at max 10Mb! I'll make a post for a bug in the official support pages (I thought this was it, though, sorry!!) Regards, Pedro Lamas
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Pedro!
The page size from your pdf is 4544 x 4064 pixels. A "normal" page size is 842 x 595 means (in german DIN A4). with 72 dpi the size will be the same - with 100 or 150 it will be larger. Seems that the included png-routines are not made for images with a size about 1.4 x 1.6 meters ;-) If you're the meaning that this is a bug you should post it at the official support pages. Cheers, Ingo |
|
PedroLamas
Beginner Joined: 07 Apr 11 Location: Portugal Status: Offline Points: 2 |
Post Options
Thanks(0)
|
Greetings,
I'm new to your forum, but the company I work on has bought and been using QuickPDF for a while now, always with full success!! :) But yesterday, I came up with a problem: I have a file that I need to output its pages to PNG at 150dpi, but this seems to throw an exception (I'm using .NET 4.0 with Interop to QuickPDF 0724) If I use: QuickPDFRenderPageToFile(instanceID, 150, 1, 5, fileName); //PNG at 150dpi this will raise an exception, but the following commands will work ok: QuickPDFRenderPageToFile(instanceID, 100, 1, 5, fileName); //PNG at 100dpi QuickPDFRenderPageToFile(instanceID, 150, 1, 0, fileName); //BMP at 150dpi QuickPDFRenderPageToFile(instanceID, 150, 1, 1, fileName); //JPEG at 150dpi QuickPDFRenderPageToFile(instanceID, 150, 1, 7, fileName); //TIFF at 150dpi Can you help me with this one please? :) You can get the file I'm using that gives this problem here: Best regards and please keep up with your good work!!! Pedro Lamas
|
|
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