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 - Original  PDF’s coordinate system
  FAQ FAQ  Forum Search   Register Register  Login Login

Original PDF’s coordinate system

 Post Reply Post Reply
Author
Message
Marat.Chariev View Drop Down
Team Player
Team Player


Joined: 18 Oct 13
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote Marat.Chariev Quote  Post ReplyReply Direct Link To This Post Topic: Original PDF’s coordinate system
    Posted: 27 Sep 14 at 4:23PM
Hi,
Is there a way to determine an Original PDF file coordinate system? I mean the Origin (Bottom-Left, Top-Left, Top-Right, Bottom-Right) which were used when PDF file was created
I tried to use function GetOrigin(), but it always returned 0. My guess - it just returns default Origin of newly created DPL object.
The reason why I need it to know – I try to create a function/procedure that handles a PDF that is rotated : downside-up or left/right turned 90 degrees, and rotate it back to a PDF which is upside-up, and save it to disc Any help is appreciated.
   

Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 453
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 28 Sep 14 at 12:18AM
If I understand you well you just want to rotate them back ?
Reference Guide say:
"
The rotation is
absolute, for example calling the function twice with a parameter of 90 will result in a page rotated
by 90 degrees, not 180 degrees.
"

So if I understand you well, the only one thing what you need to do is rotate all page using:

RotatePage(0)


Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600
Back to Top
Marat.Chariev View Drop Down
Team Player
Team Player


Joined: 18 Oct 13
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote Marat.Chariev Quote  Post ReplyReply Direct Link To This Post Posted: 28 Sep 14 at 12:53AM

Thank you for your input mLipok

Yes, you understand me right. I am dealing with scanned to PDF files documents (one page PDF file with one non searchable image in it). Some of them scanned downside-up or left/right turned 90 degrees, some of them scanned upside-up. But all of them

have  /Rotate 270 (PageRotation() function returns 270 for all scanned files) I need to determine if PDF file needs to be rotated or not, and since PageRotation() function returns 270 for all scanned files I cannot based my decision on that.

Is there anybody who has an experience with this kind of task?

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 (3) Thanks(3)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 01 Oct 14 at 1:55PM
Marat,

To reset the rotation back to 0 degrees you can use NormalizePage(0); and this is required for many PDF's if you wish to add any type of text to the PDF.

To automatically determine if a scanned image needs to be rotated then you will need to use some type of Document Imaging library.  The image will usually be converted to TIFF and then the pixels will be analysed.  There are certain parameters and formulas used to give a best guess estimate of the true orientation and these routines usually work reasonably well.

You may want to check your scanner driver to see if there is an option to do this while scanning.

Most OCR solutions require this functionality so these libraries will usually have some type of function to do this work.

Andrew.
Back to Top
Marat.Chariev View Drop Down
Team Player
Team Player


Joined: 18 Oct 13
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote Marat.Chariev Quote  Post ReplyReply Direct Link To This Post Posted: 01 Oct 14 at 3:02PM
Assuming that page should have Portrait layout I decided to use Width and Height of the page to determine if page needs to be rotated.
Back to Top
Ekta View Drop Down
Beginner
Beginner


Joined: 12 Nov 15
Location: India
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ekta Quote  Post ReplyReply Direct Link To This Post Posted: 12 Nov 15 at 8:04AM
Thanks Andrew. I needed to change the rotation of coordinate system of my pdf. It worked well.
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