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!
Check for WebLink in same spot on page |
Post Reply |
Author | |
jjohnston
Beginner Joined: 17 Dec 05 Status: Offline Points: 18 |
Post Options
Thanks(0)
Posted: 22 May 17 at 11:05PM |
I'm using the AddLinkToWeb to write annotations into a PDF but I want to make sure that I don't write one if there is already an annotation in that position already. What is the best way to check to see if there is already an annotation at that position on a page?
Any help is greatly appreciated. |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi,
you can do something similar like this one: after a LoadFromFile... //... for ipc := 1 to QP.PageCount do begin //... for iac := 1 to QP.AnnotationCount do begin if ( QP.GetAnnotStrProperty(iac, 101) = 'Link' ) or ( QP.GetAnnotStrProperty(iac, 101) = 'LINK' ) Then begin wwwlinks.Text := QP.GetAnnotStrProperty(iac, 111); wwwlinks.Items.Add(Trim(wwwlinks.Text)); end; end; //... |
|
Cheers,
Ingo |
|
jjohnston
Beginner Joined: 17 Dec 05 Status: Offline Points: 18 |
Post Options
Thanks(0)
|
I appreciate your reply but that just gets the link but does not tell me it's position on the page.
I need to know it's Left, Top, Width, Height to determine if there is already a link in that position. Is there a way to get the Left, Top, Width, Height of an annotation? |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
so you need additionally
ExtractFilePageText: http://www.debenu.com/docs/pdf_library_reference/ExtractFilePageText.php and/or GetPageText: http://www.debenu.com/docs/pdf_library_reference/GetPageText.php Both functions offers options for a csv-extraction for each string with the rectangle coordinates and more. Now your ideas will spread... Search the links you've found with the function i've told about already inside the extracted strings and then you have the location. BTW: Here's the location of the online reference and much more: http://www.quickpdf.org/ |
|
Cheers,
Ingo |
|
jjohnston
Beginner Joined: 17 Dec 05 Status: Offline Points: 18 |
Post Options
Thanks(0)
|
ahh ok...
I'm using that GetPageText function to find text that I want to create a link over but I didn't know it would find the text of existing links. I will try that. Thanks. :)
|
|
jjohnston
Beginner Joined: 17 Dec 05 Status: Offline Points: 18 |
Post Options
Thanks(0)
|
Nope... it doesn't return weblink annotations and their positions in that data.
Was worth a try though. Any other ideas?
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
You can extract all textcontent page by page.
Try different options to extract (the word by word option for example). If you've a pdf-sample with links for me you upload it anywhere posting the link here... then i'll try by my own. |
|
Cheers,
Ingo |
|
jjohnston
Beginner Joined: 17 Dec 05 Status: Offline Points: 18 |
Post Options
Thanks(0)
|
Sure... Here is an example page with a some WebLink Annotations.
There are a few that are overlapping. I need to be able to determine which ones are over lapping so that I can remove one of them. I tried just about all combinations of the functions for extracting text with no luck. It doesn't appear that there is a function for what I need exactly. I'm still holding out hope though. :) I appreciate any help or feedback.
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
No chance i fear.
I've checked the file with my own tool. It telling me that there are more than 15 links on this one pager. There's no text content - only images. Due to this text extraction isn't possible. On the page only one link is visible and working. Perhaps this could be interest for you: Here Rowan shows how to get all annotations (similar to our earlier post): http://www.quickpdf.org/forum/find-all-annotations-in-a-pdf_topic1225.html ... and then there's another function "DeleteAnnotation". So what you could do is to get all annotations, delete them all and set one new. |
|
Cheers,
Ingo |
|
jjohnston
Beginner Joined: 17 Dec 05 Status: Offline Points: 18 |
Post Options
Thanks(0)
|
I appreciate your feedback. I really need to be able to determine the RECT of the annotation to decide if it needs to be deleted or not.
If you look at the part number 36000-OS on that page you will see that there are two annotations over it. I may have to look into another tool. It's a shame though. I really love QuickPDF. I've been using it since iSED owned it. Thanks again!
|
|
jjohnston
Beginner Joined: 17 Dec 05 Status: Offline Points: 18 |
Post Options
Thanks(0)
|
I use Foxit PhantomPDF to view and edit PDFs manually. It works pretty great.
You can see the annotations that I'm talking about with that.
|
|
prakash.handsome
Beginner Joined: 22 Feb 16 Location: New Delhi Status: Offline Points: 11 |
Post Options
Thanks(0)
|
Hi Ingo,
How to Flip (Mirror Image) an Image in PDF. |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Prakash,
not good to post a NEW question into ANOTHER OLD thread ;-) I can't help and no other will look inside 'cause the thread title doesn't has to do with your question ... |
|
Cheers,
Ingo |
|
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