I am using the .DrawToWeb() functionality of the DynamicPDF Merger. It works perfectly and writes my .pdf to the current web page. My problem is that I would like the .pdf to be displayed in a new browser window preserving the existing browser screen in the background.
Is there a way to use one of the overloads from .DrawToWeb() to accomplish this or any other way? I have tried sending in a different page name like .DrawToWeb("AnotherPage.aspx"), but that did not work; it still wrote to the existing page.
I was just wondering if anyone has any suggestions on this?
Thank you,
Disply PDF on a separate web page window
Re: Disply PDF on a separate web page window
Support · Mar 20, 2008Hello,
The way to always force the created PDF is opened in a new window is to set the HTML target=”_blank” on the link or button that calls your applications.
The HTML target=”_blank” will cause the page that creates the PDF to open in a new window
Take a look at our US Envelope example. This example creates the final PDF in a new window by using target=”_blank”. This will be in the ASPX page for that example.
Thanks,
ceTe Software Support Team
Re: Disply PDF on a separate web page window
Forum member · Mar 20, 2008Yep, that US Envelopes example works as I need my project to. However, I can not see that HTML button property set "_blank" as you mentioned in the example. Does that example accomplish opening up the .pdf in a separate window another way?
Mine is still writing to the same page even when I try to emulate the codes exapmle exactly. I must be missing a property or something. Does it matter if the object I am using is a 'MergeDocument' rather than a 'DynamicPDF.Document'?
Thank you,
Re: Disply PDF on a separate web page window
Support · Mar 21, 2008Hello,
You can open the PDF in a separate window using the target=_blank without any problem. You can also refer to the Invoice example downloaded with the product download. Following is the sample HTML code for this.
<form id="FormFill" method="get" target="_blank" runat="server">
or
<a href="http://www.DynamicPDF.com" target="_blank">ceTe</a>
Using the MergeDocument or Documnet objects will not effect this.
Thanks,
ceTe Software Support Team.
Re: Disply PDF on a separate web page window
Forum member · Mar 24, 2008Well I finally figured out part of the issue. I am using ASP.NET Master and Content pages. The page I have been speaking of is an ASP.NET content page, and there is no <form> tag. That is only on the Master page. If I set that property to _blank, all of my pages would open in a separate window, which I do not want.
Basically what I did was create a separate blank .aspx page that is called with the folowing line of server side code (that uses JavaScript):
'Use JavaScript to open pop up (new .aspx page) with Adobe .pdf file
ClientScript.RegisterStartupScript(Me.GetType(), "script", "OpenAdobeApp()", True)
Prior to this I store the MergeDocument object in Session, and I pull it back out on the Page_Load of the pop up page. Then all I do is the follwing:
AdobeMergeDoc.DrawToWeb()
It works! It is only a few lines of code to get to this point, so I am not sure if there is a better way or not with a Content page.
Thank you,
Re: Disply PDF on a separate web page window
Support · Mar 24, 2008Hello,
We are not aware of any other way to do this more efficiently in content pages.
Thanks,
ceTe Software Support Team.