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

How do I create a hyperlink that opens a new browser window?
http://forum.pdfsharp.de/viewtopic.php?f=2&t=1341
Page 1 of 1

Author:  mleghorn [ Mon Sep 20, 2010 4:52 pm ]
Post subject:  How do I create a hyperlink that opens a new browser window?

In html, here is a hyperlink that opens a new browser window: <a href="http://www.mypage.com" target="_blank">New Browser Window</a>. Note that target is an attribute of the anchor tag, and its value is set to "_blank".

I want to accomplish the same think in a PDF document, generated with the PDFSharp library.

So far, I've been able to create a hyperlink in PDF, but when I click on the link, the target loads in the same browser. Here's the code I'm using to create the hyperlink:

page.AddWebLink(
new PdfRectangle(new XPoint(x, y + 200), new XPoint(x + 500, y + 210)),
"http://www.mypage.com");

How do I make this link behave so that the target gets opened in a new browser window?

Thanks!

Author:  mleghorn [ Wed Sep 22, 2010 2:53 pm ]
Post subject:  Re: How do I create a hyperlink that opens a new browser window?

No one has answered my question.

I guess I should have asked this question first:

Using PdfSharp, is it possible to create a hyperlink (in a PDF document) that opens the target site in a new browser window?

Please advise.

Thanks!

Author:  Thomas Hoevel [ Wed Sep 22, 2010 3:35 pm ]
Post subject:  Re: How do I create a hyperlink that opens a new browser window?

mleghorn wrote:
Using PdfSharp, is it possible to create a hyperlink (in a PDF document) that opens the target site in a new browser window?

I don't know.

Have you ever seen a PDF file that does this trick?
If so, where can we find it?

Author:  mleghorn [ Wed Sep 22, 2010 10:37 pm ]
Post subject:  Re: How do I create a hyperlink that opens a new browser window?

Thomas Hoevel wrote:
mleghorn wrote:
Using PdfSharp, is it possible to create a hyperlink (in a PDF document) that opens the target site in a new browser window?

I don't know.

Have you ever seen a PDF file that does this trick?
If so, where can we find it?


Thanks, you answered my question. I realized that if I open the PDF from windows explorer, I'm not opening it in IE. Then when I click on a link in the PDF, the target site opens in a new browser. This works for me!

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