Print Page | Close Window

Page dimensions are wrong

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=1534
Printed Date: 27 Sep 24 at 5:22PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Page dimensions are wrong
Posted By: Louis
Subject: Page dimensions are wrong
Date Posted: 06 Aug 10 at 3:37PM
Hi,
 
With some files, the width and height got with PageWidth and PageHeight are wrong. And the ratio between them is also wrong.
Example : 1244 mm x 899 mm instead of 969 mm x 832 mm
 
Are you aware of this trouble ? How to solve it ?
Thanks for your help.
 
Louis
 



Replies:
Posted By: Louis
Date Posted: 06 Aug 10 at 3:42PM
I'm sending the file by email...


Posted By: Louis
Date Posted: 06 Aug 10 at 3:43PM
Sorry, the file is for another topic.


Posted By: Louis
Date Posted: 10 Aug 10 at 3:27PM
Hi,
 
I have found why the dimensions may be wrong, compared to the size we get in Adobe :
The QuickPDF dimensions (got with PageHeight and PageWidth) include the margins when the document has been resized. Adobe doesn't.
 
Is there a way to get the margins, or to get the real size of the pages ?
 
Louis
 


Posted By: Ingo
Date Posted: 11 Aug 10 at 6:20AM
Hi Louis!

Not with QP-functionality.
You can save an decrypted file and then looking directly into the source.
There you'll find these values.

Cheers, Ingo



Posted By: Louis
Date Posted: 11 Aug 10 at 9:36AM
Could you plan to add this feature (very useful) in QP ?


Posted By: Louis
Date Posted: 11 Aug 10 at 1:49PM
Hi again,
 
How to save to an decrypted file and looking into the source ? My files are not encrypted, so the function DecryptFile returns 0.
 
Louis
 


Posted By: Louis
Date Posted: 11 Aug 10 at 2:19PM
My last question (decrypted file) is still interesting for me, but I found a simple solution to get the real dimensions of the pages :
The GetPageBox function can return the real height or the real width of the selected page.
So, that's nice. I'll use this function instead of PageHeight and PageWidth.
 
Louis


Posted By: Ingo
Date Posted: 11 Aug 10 at 2:26PM
Hi!

You can treat the document like normal ascii-code.
Read it into a string with "normal" syntax of your IDE and read the content with POS or something similar.

Thanks for the PageBox-hint ;-)

Cheers, Ingo

BTW: This is a user-user-forum - so your feature-request here won't be succesfully ;-)
 


Posted By: Louis
Date Posted: 11 Aug 10 at 2:46PM
Hi,
 
So, that's a hard job ! Pdf files may be very long and complex !!
Anyway, PageBox is more useful.
 
I have a last question about the dmensions : how to resize a page and delete permently the margins or the cropped area ?
 
Louis


Posted By: Rowan
Date Posted: 12 Aug 10 at 1:20PM
> I have a last question about the dmensions : how to resize a 
> page and delete permently the margins or the cropped area ?

It's not currently possible to permanently delete the objects that are outside of the cropped area -- however, we're looking at adding support for redacting objects that lay outside a certain area in the future.

As a workaround you could crop the document, update the MediaBox using the dimensions retrieved from the CropBox using the GetPageBox function and then render the PDF to an image and then convert it back to a PDF.

This would ensure that there was no hidden objects anymore, but then you would have a PDF file without any actual text (just an image of text) and no interactive elements (i.e. form fields, annotations, etc). So it's a bit of a hack, but might work for you in some cases.

Cheers,
- Rowan.



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