PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Mar 19, 2024 9:37 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: hyperlink
PostPosted: Thu Nov 07, 2019 6:59 pm 
Offline

Joined: Sun Nov 03, 2019 7:51 pm
Posts: 47
hi

How can I make a hyperlink working inside the PDF file?
I want to make a hyperlink and if you click it, it must go to a certain text line in the PDF file.

Can somebody explain with the required method calls?

I'm using MigraDoc.


Top
 Profile  
Reply with quote  
 Post subject: Re: hyperlink
PostPosted: Thu Nov 07, 2019 7:29 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 905
Location: CCAA
Hi!

Add a bookmark at the target location, add a reference to that bookmark where you want to have the link.

See "AddHyperlink" in this sample:
http://pdfsharp.net/wiki/HelloMigraDoc-sample.ashx

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
 Post subject: Re: hyperlink
PostPosted: Thu Nov 07, 2019 7:47 pm 
Offline

Joined: Sun Nov 03, 2019 7:51 pm
Posts: 47
Hi

So the string you pass to method AddBookmark() must be exactly the same as the string you pass to AddHyperlink() ?

Is it AddHyperlink() or AddPageRefField() that makes the hyperlink work when clicked? I'm not sure

Does it work this way?


Top
 Profile  
Reply with quote  
 Post subject: Re: hyperlink
PostPosted: Thu Nov 07, 2019 11:22 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 905
Location: CCAA
AddPageRefField shows the page number of the target, AddHyperlink makes it clickable.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
 Post subject: Re: hyperlink
PostPosted: Sat Nov 09, 2019 12:07 am 
Offline

Joined: Sun Nov 03, 2019 7:51 pm
Posts: 47
Thx everything is working!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 85 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group