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 - Check for WebLink in same spot on page
  FAQ FAQ  Forum Search   Register Register  Login Login

Check for WebLink in same spot on page

 Post Reply Post Reply
Author
Message
jjohnston View Drop Down
Beginner
Beginner


Joined: 17 Dec 05
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote jjohnston Quote  Post ReplyReply Direct Link To This Post Topic: Check for WebLink in same spot on page
    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.
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 23 May 17 at 5:22PM
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

Back to Top
jjohnston View Drop Down
Beginner
Beginner


Joined: 17 Dec 05
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote jjohnston Quote  Post ReplyReply Direct Link To This Post Posted: 24 May 17 at 6:46PM
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?

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 24 May 17 at 7:36PM
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

Back to Top
jjohnston View Drop Down
Beginner
Beginner


Joined: 17 Dec 05
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote jjohnston Quote  Post ReplyReply Direct Link To This Post Posted: 24 May 17 at 9:01PM
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.  :)
Back to Top
jjohnston View Drop Down
Beginner
Beginner


Joined: 17 Dec 05
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote jjohnston Quote  Post ReplyReply Direct Link To This Post Posted: 24 May 17 at 9:14PM
Nope... it doesn't return weblink annotations and their positions in that data.

Was worth a try though.

Any other ideas?
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 24 May 17 at 9:27PM
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

Back to Top
jjohnston View Drop Down
Beginner
Beginner


Joined: 17 Dec 05
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote jjohnston Quote  Post ReplyReply Direct Link To This Post Posted: 25 May 17 at 5:51AM
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.
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 25 May 17 at 10:58PM
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

Back to Top
jjohnston View Drop Down
Beginner
Beginner


Joined: 17 Dec 05
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote jjohnston Quote  Post ReplyReply Direct Link To This Post Posted: 26 May 17 at 3:15AM
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!
Back to Top
jjohnston View Drop Down
Beginner
Beginner


Joined: 17 Dec 05
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote jjohnston Quote  Post ReplyReply Direct Link To This Post Posted: 26 May 17 at 3:17AM
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.
Back to Top
prakash.handsome View Drop Down
Beginner
Beginner


Joined: 22 Feb 16
Location: New Delhi
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote prakash.handsome Quote  Post ReplyReply Direct Link To This Post Posted: 01 Jun 17 at 7:17AM
Hi Ingo, 

How to Flip (Mirror Image) an Image in PDF.

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 15 Jun 17 at 2:57PM
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

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