Print Page | Close Window

ImageHorizontalResolution

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=1435
Printed Date: 18 Jan 26 at 5:43PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: ImageHorizontalResolution
Posted By: jvonbokel
Subject: ImageHorizontalResolution
Date Posted: 03 May 10 at 5:40PM
When I try to use ImageHorizontalResolution or ImageVerticalResolution on a bitmap, it only returns 0.  Is there another way to get the resolution of a bitmap?  I tried a built-in Bitmap.FromFile(source) in vb.net, but it gives an out of memory error on large files (600-700MB), which is apparently due to the fact that the bitmap must be stored contiguously in virtual memory.  I also tried reading the binary header, but the resolution fields are unreliable.  Some files are accurate, others are useless.

John



Replies:
Posted By: Ingo
Date Posted: 03 May 10 at 7:08PM
Hi John!

It should be more than seldom that a 700 mb image was inserted in a pdf 'cause "normally" the creator wants that somebody shall load and open the pdf ;-)

The image-dimensions from built-in images you can only get if you had inserted them before. This doesn't work on already existing, old images. If you want this you can do it by yourself.
To do it you should load the pdf, decrypt it and save it unencrypted as a temp-file. This temp-file you can examine. Open a pdf with an editor like notepad and have a direct look into the pdf then you'll know what to examine.

Cheers, Ingo
  


Posted By: jvonbokel
Date Posted: 04 May 10 at 11:05PM
Is there a limit to the size of an image in a pdf made with QuickPDFLibrary?  I found a way to determine the dimensions and resolution of my large bitmaps without opening them, but when I try to insert the image, it fails.

In vb.net, I use:

imgID = QP.AddImageFromFile(source, 0)

and I get success for files as large as ~178MB, but imgID is zero for files ~317MB and up (I don't presently have samples between those two sizes).

Thanks,
John


Posted By: Ingo
Date Posted: 05 May 10 at 6:09AM
Hi John!

There's not a known limit but the functionality of inserting an image needs a multiple of the original bytes of the image. So inserting an 100 mb image into a pdf-document doesn't need 100 mb ram may perhaps 500? I'll give a hint to the developers of QuickPDF about this thread... perhaps they can tell a bit about the case you described.

Cheers, Ingo



Posted By: jvonbokel
Date Posted: 05 May 10 at 4:45PM
I was able to insert them without issue using PDFlib, so it should be possible.  Unfortunately PDFlib doesn't support the OGC GeoPDF spec, though, which is what drew me to QuickPDFLibrary in the first place.  I wonder if I could cut the images into halves (or smaller) and "re-assemble" them inside the PDF by placing them adjacent to each other on the page.



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