how to open PDF at runtime using XSLFO input
Joined: 06 May 2011
Topic: how to open PDF at runtime using XSLFO input
Posted: 06 May 2011 at 3:02pm
I have the following code that creates the PDF file on the machine. But, I require, I user click on the View PDF link, the PDF file should be generated at runtime and open.
How can I write code to open the PDF on the fly without writing on the disk?
Joined: 06 Aug 2008
|Post Options Quote Reply Posted: 10 May 2011 at 10:37am|
You can't open PDFs directly from memory because Adobe Reader doesn't support it. Even if you write the PDF stream into the response, it causes the file to be downloaded into the Temporary Internet Files folder and then opened from there.
You have 2 options: either write it into the response stream with Response.Write() if you're in ASP.NET and it will open in the browser, or write it to the temporary folder and use System.Diagnostics.Process.Start(pathToFile) to open it in its native application.
|Forum Jump||Forum Permissions
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum