Try adding:

  FORMATOPTION 'ATTACHMENT=my.pdf'

This should set the appropriate http header element.

Steve

From: [email protected] 
[mailto:[email protected]] On Behalf Of Donald Kerr
Sent: Wednesday, June 25, 2014 9:16 AM
To: Basques, Bob (CI-StPaul); [email protected]
Subject: Re: [mapserver-users] PDF output and file naming (.pdf)

This is what I use (with some notes):

      # PDF
      # Required to change MIMETYPE for outputting PDFs as application/x-pdf
      OUTPUTFORMAT
            NAME "pdf"
            DRIVER "CAIRO/PDF"
            # MIMETYPE "application/x-pdf" # Original
            MIMETYPE "application/pdf" #MIME type of "application/pdf" for pdfs 
as "application/x-pdf" not always recognised as pdf by browser
            IMAGEMODE "RGBA"
            EXTENSION "PDF"
            TRANSPARENT ON # Requires RGBA, not RGB otherwise errors. Also 
requires OFFSITE 255 255 255 in LAYER
      END



From: 
[email protected]<mailto:[email protected]>
 [mailto:[email protected]] On Behalf Of Basques, Bob 
(CI-StPaul)
Sent: 25 June 2014 15:12
To: [email protected]<mailto:[email protected]>
Subject: [mapserver-users] PDF output and file naming (.pdf)

All,

I got the PDF output to work, but the outputted file ends up being output as 
<some_name>.map.

I'm using CGI (streaming result?) with map.imagetype=pdf, the result is indeed 
a PDF, but with a .map file name.

I tried setting  EXTENTION "pdf" and MIMETYPE "application/x-pdf" inside of 
FORMATOPTION to no effect as far as the file name tag.  Do I maybe need to 
output temporarily to a server location (WEB) for subsequent download?

Thanks

bobb
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to