All,

Ok, this worked (Thanks Donald):

   OUTPUTFORMAT
        NAME pdf
        #MIMETYPE "application/x-pdf"
        MIMETYPE "application/pdf"
        DRIVER "CAIRO/PDF"
        IMAGEMODE RGBA
        EXTENSION "PDF"
        TRANSPARENT ON
    END


On 6/25/14 10:22 AM, Lime, Steve D (MNIT) wrote:
Try adding:

  FORMATOPTION 'ATTACHMENT=my.pdf'
This is a new one, I didn't see that anywhere in the docs.

I don't suppose I can pass a fname=my.pdf param value in through the CGI call 
for the naming, or can I?

One other thing, is there a way to force a VECTOR  pdf output vs Raster.  Using 
the above I seem to be getting a Raster output.

Thanks (some more)

bobb



This should set the appropriate http header element.

Steve

From: 
[email protected]<mailto:[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]<mailto:[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