[mapserver-users] PDF output and file naming (.pdf)
Lime, Steve D (MNIT)
Steve.Lime at state.mn.us
Wed Jun 25 08:22:58 PDT 2014
Try adding:
FORMATOPTION 'ATTACHMENT=my.pdf'
This should set the appropriate http header element.
Steve
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Donald Kerr
Sent: Wednesday, June 25, 2014 9:16 AM
To: Basques, Bob (CI-StPaul); mapserver-users at lists.osgeo.org
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: mapserver-users-bounces at lists.osgeo.org<mailto:mapserver-users-bounces at lists.osgeo.org> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Basques, Bob (CI-StPaul)
Sent: 25 June 2014 15:12
To: mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20140625/ecf59e34/attachment.htm>
More information about the MapServer-users
mailing list