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 - Incorrectly positioned coordinate system
  FAQ FAQ  Forum Search   Register Register  Login Login

Incorrectly positioned coordinate system

 Post Reply Post Reply
Author
Message
Goldstick View Drop Down
Beginner
Beginner


Joined: 11 Jun 14
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Goldstick Quote  Post ReplyReply Direct Link To This Post Topic: Incorrectly positioned coordinate system
    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
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3529
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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:
Please read detailed at SetOrigin, GetOrigin and SetMeasurementUnits.

Cheers and welcome here,
Ingo



 
Cheers,
Ingo

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 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.
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