Generate Pdf in new browser

Generate Pdf in new browser

Forum member · Mar 15, 2011
Hi, I'm using Merge Document and drawtoweb("test.pdf") to display the generated pdf in same browser,But I want to display in new browser. I went through the forum,I couldn't find suitable sample code.Can you please share some sample code to display generated pdf in different browser. Thanks in advance -Ajith

Re: Generate Pdf in new browser

Support · Mar 15, 2011
Hello Ajith, 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. Please refer to the Acro Form Filler example & source code provided on our website. Thanks, ceTe Software Support Team.

Re: Generate Pdf in new browser

Forum member · Mar 15, 2011
Thanks for quick reply,I went through it,but We are master pages I am not able to use form tag.Do you any other alternate to achieve this? Regards

Re: Generate Pdf in new browser

Support · Mar 15, 2011
Hello, In that case you can add java script code to the button click event to open a new page in a new window and include the code that generates the PDF in the page load event of the new page and call DrawToWeb method at the end of the page load event. Button1.Attributes.Add("OnClick", "javascript:var p=window.open('Default2.aspx','mywindow','width=1000,height=800,resizable=yes'); return false;"); In the above example code you may include all the PDF generation code in the Default2.aspx page. Thanks, ceTe Software Support Team.