[mapserver-users] PDF output and file naming (.pdf)

Basques, Bob (CI-StPaul) bob.basques at ci.stpaul.mn.us
Wed Jun 25 09:21:21 PDT 2014


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: 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 Donald Kerr
Sent: Wednesday, June 25, 2014 9:16 AM
To: Basques, Bob (CI-StPaul); mapserver-users at lists.osgeo.org<mailto: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/9061ad86/attachment.htm>


More information about the MapServer-users mailing list