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!
![]() |
Incorrectly positioned coordinate system |
Post Reply ![]() |
Author | |
Goldstick ![]() Beginner ![]() Joined: 11 Jun 14 Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() 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 =) ![]() Thanks |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
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: Please read detailed at SetOrigin, GetOrigin and SetMeasurementUnits. Cheers and welcome here, Ingo |
|
Cheers,
Ingo |
|
![]() |
|
AndrewC ![]() Moderator Group ![]() ![]() Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
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.
|
|
![]() |
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