in reply to Re: Open generated PDF in new tab/new page in HTML::Mason
in thread Open generated PDF in new tab/new page in HTML::Mason

It would be helpful if you described how it is not working. What do you get back, a blank page or a page full of garbage or does the server just hang?

When I run following command in console:

perl -le "system 'c:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.ex +e', 'D:\www\my.pdf'"
Acrobat opens and displays my.pdf as expected. Then I add % system 'c:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe', 'D:\www\my.pdf'; in HTML file and load in browser. The page gets displayed correctly, but there is no additional Acrobat window with my.pdf. I am not sure if I can expect browser to open Acrobat window in such way... Anyway, Javascript suggested by Gangabass leads me in another direction and there will be place for 'normal' headers and standard redirection.

++ for the trick with iframe - it works. How to use it when I return 'application/pdf' in HTTP header?

Replies are listed 'Best First'.
Re^3: Open generated PDF in new tab/new page in HTML::Mason
by pc88mxer (Vicar) on May 12, 2008 at 06:08 UTC
    Then I add % system 'c:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe', 'D:\www\my.pdf'; in HTML file and load in browser.
    You are doing this in your Mason file, right? This will run Acrobat on your server, not the client's machine.
    ++ for the trick with iframe - it works. How to use it when I return 'application/pdf' in HTTP header?
    You have to create a URL which returns your PDF file. You then specify that URL as the src= parameter to the iframe. For instance, try this in the above example HTML document:
    <iframe src="http://www.niso.org/publications/rp/RP-6-2008.pdf"></ifra +me>