You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Steve Smith <st...@isay.com.au> on 2001/11/01 03:02:19 UTC

RE: [OT] pdf creation

simran  writes:
> I believe there is also a Content-disposition tag you can use to
> tell the browser what to name the file...

As mentioned below in my original post, it doesn't work in all
browsers.

Steve

Re: [OT] pdf creation

Posted by Igor Sysoev <is...@rambler-co.ru>.
On Wed, 31 Oct 2001, Wim Kerkhoff wrote:

> Steve Smith wrote:
> > 
> > simran  writes:
> > > I believe there is also a Content-disposition tag you can use to
> > > tell the browser what to name the file...
> > 
> > As mentioned below in my original post, it doesn't work in all
> > browsers.
> 
> Like you say, PATH_INFO works for many browsers. I ran into issues with

It works for any browser. Browser doesn't no anything about PATH_INFO.

> IE not using it properly... I ended up having to tack "&MYPDFFILE.pdf"
> onto the end of the URI, just so that it would use the correct
> extension. Something to try perhaps. e.g.:
> 
> http://server/perl/pdfgen.pl/MYPDFFILE.pdf?&MYPDFFILE.pdf
> 
> In my case, I had to do this trick to get *.exe files to download as
> *.exe instead of *.com.

Why do you use "?&MYPDFFILE.pdf" ? I think that

http://server/perl/pdfgen.pl/MYPDFFILE.pdf

would be enough for MSIE.

Igor Sysoev


Re: [OT] pdf creation

Posted by Wim Kerkhoff <wi...@merilus.com>.
Steve Smith wrote:
> 
> simran  writes:
> > I believe there is also a Content-disposition tag you can use to
> > tell the browser what to name the file...
> 
> As mentioned below in my original post, it doesn't work in all
> browsers.

Like you say, PATH_INFO works for many browsers. I ran into issues with
IE not using it properly... I ended up having to tack "&MYPDFFILE.pdf"
onto the end of the URI, just so that it would use the correct
extension. Something to try perhaps. e.g.:

http://server/perl/pdfgen.pl/MYPDFFILE.pdf?&MYPDFFILE.pdf

In my case, I had to do this trick to get *.exe files to download as
*.exe instead of *.com.

In the couple of PDF scripts that I have written, I used other modules
to create a PostScript or PNG file, then used a system call to convert
it to a PDF.  For something that isn't being used very often this should
be acceptable. Once its a PDF on the system, the file can read in and
printed to STDOUT or a redirect to http://server/tmpfiles/$randomtmpfile
can be done.

-- 

Regards,

Wim Kerkhoff, Software Engineer
Merilus, Inc.  -|- http://www.merilus.com
Email: wim@merilus.com