PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Hyperlink to other PDF
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3670
Page 1 of 1

Author:  Gerhard [ Thu Oct 05, 2017 10:15 pm ]
Post subject:  Hyperlink to other PDF

Hi,

I'm trying to add links to external PDF files (possibly relative to the path where the linking PDF is located) to a PDF file created with MigraDoc GDI+ 1.50.4619-beta4c but the links don't work. If I open the created file in Acrobat, edit a link but let it point to the same file, it works. In Acrobat (Tools->Add or Edit Link) I cannot see any difference and if I open both files in an editor, even the link code
"/A <</Type/Action/S/Launch/F<</Type/Filespec/F(c:/temp/test1.pdf)>> >>".
is identical in both files.

What am I doing wrong?

Here is my C# code:
paragraph = section.AddParagraph();
Hyperlink hyperlink = new Hyperlink();
hyperlink.AddText("Link");
hyperlink.Name = @"c:/temp/test1.pdf";
hyperlink.Type = HyperlinkType.File;
paragraph.Add(hyperlink);

using
hyperlink.Name = @"file:///c:/temp/test1.pdf";

gives the same results.

Regards

Gerhard

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