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!
![]() |
Best way to handle images - pixels and millimeter |
Post Reply
|
| Author | |
that0th3rGuy
Beginner
Joined: 01 Sep 10 Location: South Africa Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Topic: Best way to handle images - pixels and millimeterPosted: 16 Nov 11 at 7:04AM |
|
Good day,
I am currently using QuickPDF 7.16 The FAQ post http://www.quickpdflibrary.com/faq/i-want-to-draw-an-image-onto-a-pdf-but-the-page-size-is-in-millimeters-and-the-i.php refers. The mentioned post helped a little bit, but I still don't know how I am going to draw my pixel-measured image onto a millimeter-measured document accurately every time regardless of environment. I can't really make an assumption as to the dpi configuration on a client's machine. I there a way to programmatically determine Acrobat's dpi settings in order to generate a PDF document accordingly? Thanks
|
|
![]() |
|
AndrewC
Moderator Group
Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
Quote Reply
Posted: 16 Nov 11 at 7:59AM |
|
points, mm and mm are constant measurements. QP.ImageHorizontalResolution() QP.ImageVerticalResolution() QP.ImageWidth() and ImageHeight() will return the pixel width and height of your image. From here you can work out the physical size of the image. ImageWidthInInches = QP.ImageWidth() / QP.ImageHoizontalResolution(); ImageWidthInmm = ImageWidthInInches * 25.4 7.16 is an older version and there have been may bug fixes. You are entitled toa free upgrade to the 7.26 version which can be downloaded from http://www.quickpdflibrary.com/downloads/binaries/qp/oldversions/0726/quick_pdf_library.exe Andrew. |
|
![]() |
|
that0th3rGuy
Beginner
Joined: 01 Sep 10 Location: South Africa Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 16 Nov 11 at 8:54AM |
|
Alright, thanx; I'll give that a go.
In the meantime could you please explain something to me? The documentation says that ImageHorizontalResolution() and ImageVerticalResolution() respectively returns the horizontal and and vertical resolutions of the selected image. Does that mean that I'll need to add the image, determine resolution, remove the image, do the calculation and then add the image with it's new dimensions? Thanx.
|
|
![]() |
|
AndrewC
Moderator Group
Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
Quote Reply
Posted: 16 Nov 11 at 10:27AM |
|
No.
You can add the image which add the pixel scanline as a resource in the PDF. You then obtain the resolution. A 100 x 100 pixel image will always remain that size in pixels. When you draw the image it is scaled to the size required. If you told it to draw a 100x100mm image then each pixel could would be 1mm square on the page. Andrew.
|
|
![]() |
|
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