Print Page | Close Window

Incorrectly positioned coordinate system

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=2920
Printed Date: 28 Jun 25 at 1:38PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Incorrectly positioned coordinate system
Posted By: Goldstick
Subject: Incorrectly positioned coordinate system
Date Posted: 11 Jun 14 at 12:02PM
Hello

I have a PDF and want to add additional text boxes.
The document is scanned.
Unfortunately, the coordinate system is not correct.
If I want to write something on the null coordinates it is in the middle of the page and not, as in all other PDFs top left.
I need help =)Cry

Thanks



Replies:
Posted By: Ingo
Date Posted: 11 Jun 14 at 6:20PM
Hi Goldstick,

it depends on the values you're using:
The media- or cropbox-dimensions or pagewidth/-height (better using the boxes).
And first of all (before to calculate the new positions) you should use SetOrigin.
To set the MeasurementUnits could be helpful, too.

Another point:
A pdf document could be made with rotate-functionality - so your calculated positions are rotated, too. With QuickPDF you can check if there's a rotation.

The coordinate system is inside the pdf document and it can be different but with the things i've told before this shouldn't be a problem.

Have a look here:
http://www.debenu.com/docs/pdf_library_reference/MeasurementAndCoordinateUnits.php" rel="nofollow - http://www.debenu.com/docs/pdf_library_reference/MeasurementAndCoordinateUnits.php
Please read detailed at SetOrigin, GetOrigin and SetMeasurementUnits.

Cheers and welcome here,
Ingo



 


-------------
Cheers,
Ingo



Posted By: AndrewC
Date Posted: 16 Jun 14 at 7:25AM
The most likely issue is that the co-ordinate system needs to be reset back to default settings.

Add a call to  QP.NormalizePage(0);  once per page before drawing the text.

Many PDF's leave the corrdinate system in an unknown state because they know the current state but don't bother to reset it at the end when they are finished.  When you add text to the end of a content stream the coordinate system is set by the original PDF and that is what you are seeing on some PDF's.  NormalizePage will wrap a savestate / restorestate around the content streams thus making it safe to draw text.

Andrew.



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