Print Page | Close Window

Quad Points to Left/Top/Width/Height

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=3119
Printed Date: 28 Apr 24 at 12:48AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Quad Points to Left/Top/Width/Height
Posted By: jjohnston
Subject: Quad Points to Left/Top/Width/Height
Date Posted: 22 May 15 at 7:34AM
Is there a function to convert the quad points returned from GetPageText(4) to Left/Top/Width/Height values that can be used with the AddLinkToWeb function?

I need to be able to create these annotations programmatically over specific words in a document.
Also is there a way to change the background color of an annotation and set the opacity level?

Any help would be greatly appreciated.



Replies:
Posted By: erico
Date Posted: 22 May 15 at 3:24PM
Getting the Left/Top/Width/Height is simple math from the returned quad points. Just remember to use the appropriate pairs based upon your SetOrigin (e.g. for SetOrigin(0), Left/Top are X4, Y4; width is X3 - X4; height is Y4 - Y1)

From the documentation, it appears you can obtain color details via GetAnnotStrProperty (118 = color space) and GetAnnotDblProperty (119-126 are different color components) but curiously these values are not available to the corresponding SetAnnot...Property() functions.


-------------
Eric O


Posted By: jjohnston
Date Posted: 26 May 15 at 4:03PM
Ok... great.  That's what I was doing but on some documents the positions are off.
I did not account for the Origin.  I discovered an old post of mine asking pretty much the same question years ago.  I'm still using the library the same way.  Was just hoping that there might be a better way to do this now.

Thanks for the reply.  I'll keep looking for a solution for setting the background color and opacity of the link annotation.  If anyone has any ideas, I'd love to hear them.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk