how to use GetOrigin function ?
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=2328
Printed Date: 02 May 26 at 3:44PM Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com
Topic: how to use GetOrigin function ?
Posted By: jdddahl
Subject: how to use GetOrigin function ?
Date Posted: 04 Jul 12 at 10:11AM
I work on a very basic module which takes PDF files on input and gets all text data in. Fot that, I use the function DAExtractPageText
Generally, it works fine, but I encountered a document with all items having negative Y coordinates.
In fact, these coordinates start from the top (beeing negative) instead of the expected (positive) values described in the DAExtractPageText function. "...The co-ordinates are the four points bounding the text, measured in points (1/72 inch) with the bottom-left corner of the page as the origin...."
Reading the description given with the SetOrigin function, I expected to get the same information using GetOrigin in order to use it accordingdly.
For all files (even the one which gave me negative coordinates) , I always get the value "0" from GetOrigin (meaning "bottom-left")
Is GetOrigin not helpful in that situation? Is there another way for knowing the coordinate system for a given PDF document we open?
many thanks for help.
|
Replies:
Posted By: Ingo
Date Posted: 04 Jul 12 at 10:27AM
Hi!
Perhaps this issue has additonally to do with the option "rotated"? You can check this with function "PageRotation": http://www.quickpdflibrary.com/help/quickpdf/PageRotation.php
Cheers and welcome here, Ingo
|
Posted By: jdddahl
Date Posted: 04 Jul 12 at 1:51PM
Thank you Ingo,
I've tried both: property PageRotation and function DAPageRotation => Always returning '0' as if document was not rotated.
Isn't it related to the way or version the PDF file was generated with? Shouldn't GetOrigin return a consistent value anyway?
main functions used are:
var iPDFLibrary = new ActiveXObject("QuickPDFAX0815.PDFLibrary") ; // OK
var nResult = iPDFLibrary.Unlockkey(szLicenceKey) ; // OK
var nFileHandle = iPDFLibrary.DAOpenFile(szPDFFile,'') ; // OK
var iPageReference = iPDFLibrary.DAFindPage(nFileHandle,nPage) ; //OK
var nOriginSystem = iPDFLibrary.GetOrigin() ; // ?
var nRotation = iPDFLibrary.DAPageRotation(nFileHandle,nPage) ; // ?
var nPageHeight = iPDFLibrary.DAGetPageHeight(nFileHandle,iPageReference) ; //OK
var nPageWidth = iPDFLibrary.DAGetPageWidth(nFileHandle,iPageReference) ; //OK
var szPageContentBuffer =
iPDFLibrary.DAExtractPageText(nFileHandle,iPageReference,4) ; // OK but
some Y coords return <0 values
|
|