Open Link in a new browser window

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Generator for .NET (v3 and older)  /  Open Link in a new browser window

DynamicPDF Generator for .NET (v3 and older) Forum

 Dec 07 2005 2:04 PM
I would like to create a link that opens the page in a new browser window, like this link would:
<a href="mypage.htm" target="_blank">my link</a>
Posted by a ceTe Software moderator
Hello,

To open the PDF in a new window you will need to set target property on the form or link that creates the PDF equal to target="_blank". That will cause the PDF to be created and opened in a new window.

Take a look at the USEnvelope example in the Generator examples.  This shows you exactly that.  Using the target="_blank" in the aspx page it causes the PDF to get created in a new window.

Thanks,
ceTe Software Support Team
Hi,
I'm not trying to open the PDF in a new window, I'm trying to make a link ON THE PDF open up in a new window.

I have a page that creates a PDF with links like so:

Dim action As UrlAction = New UrlAction("targetpage.htm")
Dim MyLink As Link = New Link(nX, nY, nW, nH, action)
Dim lbl As Label = New Label("Click Here", nX, nY, nW, 10, Font.Helvetica, 10, TextAlign.Left, Color.Black)
Pg.Elements.Add(MyLink)

The page does not have a form tag that I could insert target="_blank" into.  The only thing it contains is the <%@ Page ... %> directive.

When a link is clicked on the PDF, I would like the url (targetpage.htm) to open up in a new window.  Currently, the url opens in the current window and the only way to return to the PDF is to click the back button and re-generate the PDF.  All of the display settings of the PDF are lost: page number, zoom level, window size, etc.
Posted by a ceTe Software moderator
Now I understand what your request is, but unfortunately this is not possible with a PDF link.  You see, a link in PDF does not have a target like that in an HTML link making this ability not possible.

This is a limitation of PDF itself and it is not a limitation that is specific to our product.

Thanks,
ceTe Software Support Team
 Mar 02 2006 10:57 PM
When developing modules under DotNetNuke you do not have the _target property available...  Is there a way via code to set this property so the PDF will open in a new window??
 Mar 03 2006 10:32 AM
Posted by a ceTe Software moderator
Hello,

The target=_blank property is an attribute off the <a> tag. It can be used to open any URL in a new window. Attributes appear inside the opening tag and their value is always inside quotation marks. A URL link to open in new window will look like this:

<a href="http://www.DynamicPDF.com" target="_blank">ceTe Software</a>

You can also force the output to open in new window using the javascript as follow:

<FORM>
          <INPUT type="button" value="New Window!" onClick="window.open(URL,'mywindow','width=400,height=200,toolbar=yes,
location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes, resizable=yes')">
</FORM>

Thanks,
ceTe Software Support Team
Almost 15 years after this post... Is there any way to have the UrlAction open the URL in a new browser window now? I have the same issue, when viewing a PDF in a browser window, and click the UrlAction, it opens the target in the same page and not a new page. thanks!
Posted by a ceTe Software moderator
Hello,

Unfortunately, these still isn't a way to control this. This is a limitation of the PDF format and not our APIs specifically.

Thanks,
ceTe Software Support Team

All times are US Eastern Standard time. The time now is 11:02 AM.