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!
![]() |
Original PDF’s coordinate system |
Post Reply ![]() |
Author | |
Marat.Chariev ![]() Team Player ![]() Joined: 18 Oct 13 Status: Offline Points: 24 |
![]() ![]() ![]() ![]() ![]() 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. |
|
![]() |
|
mLipok ![]() Senior Member ![]() ![]() Joined: 23 Apr 14 Location: Poland, Zabrze Status: Offline Points: 453 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Marat.Chariev ![]() Team Player ![]() Joined: 18 Oct 13 Status: Offline Points: 24 |
![]() ![]() ![]() ![]() ![]() |
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? |
|
![]() |
|
AndrewC ![]() Moderator Group ![]() ![]() Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
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.
|
|
![]() |
|
Marat.Chariev ![]() Team Player ![]() Joined: 18 Oct 13 Status: Offline Points: 24 |
![]() ![]() ![]() ![]() ![]() |
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.
|
|
![]() |
|
Ekta ![]() Beginner ![]() Joined: 12 Nov 15 Location: India Status: Offline Points: 1 |
![]() ![]() ![]() ![]() ![]() |
Thanks Andrew. I needed to change the rotation of coordinate system of my pdf. It worked well.
|
|
![]() |
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