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 - Best way to handle images - pixels and millimeter
  FAQ FAQ  Forum Search   Register Register  Login Login

Best way to handle images - pixels and millimeter

 Post Reply Post Reply
Author
Message
that0th3rGuy View Drop Down
Beginner
Beginner
Avatar

Joined: 01 Sep 10
Location: South Africa
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote that0th3rGuy Quote  Post ReplyReply Direct Link To This Post Topic: Best way to handle images - pixels and millimeter
    Posted: 16 Nov 11 at 7:04AM
Good day,

I am currently using QuickPDF 7.16


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
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 16 Nov 11 at 7:59AM
points, mm and mm are constant measurements.

You need to work the other way around.  You need to determine the DPI from the image and use that to determine how big to draw the image.

  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.


Back to Top
that0th3rGuy View Drop Down
Beginner
Beginner
Avatar

Joined: 01 Sep 10
Location: South Africa
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote that0th3rGuy Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post 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.
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