Do you own a Debenu Quick PDF Library 12/11/10/9/8/7? Upgrade to Debenu Quick PDF Library 13!

Foxit Quick PDF Library

Frequently Asked Question:

Return to FAQ Index

AddLinkToPage position

Question

I have to start from an already created PDF (from a Word doc exported to PDF), I need to pragmatically add pages and link existing text to this pages.

How can I get position starting from a phrase ?

I think I need:

1) Found the text I'm looking for 2) Get # of page into document 3) Get rectangle for the string 4) Add a blank page at the end of document and fill with information/images 5) call AddLinkToPage

But how can I succeded in step 1..3 ?

TIA

Answer

The GetPageText function will help you accomplish most of what you're trying to do.

  1. The GetPageText function will allow you to extract all of the text from each page in a document. This function also returns the co-ordinates and font information for text found on the page. As shown in this example, you can then search the extracted text for a keyword match and then also access the page number, co-ordinates and font information for the matching text.
  2. When using the GetPageText function you will need to loop through each page in the document, so you will already have this information. You can use the PageCount function to count all of the pages the selected document.
  3. The co-ordinates for the rectangular area that the text is located is returned by the GetPageText function.
  4. New pages can be added to a document using the NewPage function.
  5. Then the AddLinkToPage function can be called using the information that you have retrieved using the GetPageText function.

© 2015 Debenu & Foxit. All rights reserved. AboutBuyContactBlogNewsletterSupportFAQProduct UpdatesForum