PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

Modifying text to be links in an existing PDF
http://forum.pdfsharp.com/viewtopic.php?f=2&t=4339
Page 1 of 1

Author:  letdowncrush [ Wed Apr 27, 2022 8:56 am ]
Post subject:  Modifying text to be links in an existing PDF

Hi,

I have an existing PDF. It's generated by another system with no bookmarks and the Table of Contents has been built but is not clickable.

I'd like to amend the PDF so that the text in the Table of Contents is clickable and add bookmarks / useful navigation pane.

Complete newbie to the project here and was wondering if anyone had any pointers or sample code they could share?

I think I've worked out how to add the bookmarks thanks to some of the sample code on the website but struggling a bit with the Table of Contents hyperlinks.

I'm using the assumption for the purposes of my PoC that the text requiring to be turned into links will be preceded by an `@`, so a) will have to locate the text, b) remove the '@' character and c) wrap the text in a link that goes to Page N.

Thanks!

Author:  TH-Soft [ Thu Apr 28, 2022 9:06 am ]
Post subject:  Re: Modifying text to be links in an existing PDF

Hi!

For the links you must specify the clickable area on the page. Potentially difficult to find that area if transformations are used.
There are some useful routines that show how you can extract text from PDF using PDFsharp.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/