Ticket #4216 (closed enhancement: fixed)
[PATCH] Add support for writing geospatial PDF
| Reported by: | rouault | Owned by: | tbonfort |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.2 release |
| Component: | Output-PDF | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: |
Description
The attached patch relies on the very latest version of the PDF driver from GDAL trunk to add geospatial information to the PDF file produced by the Cairo/PDF mapserver backend.
In order to be triggered, one has to add a FORMATOPTION "GEO_ENCODING=ISO32000" into the OUTPUTFORMAT definition of the CAIRO/PDF driver. Additional options can also be added in order to set Info keywords. For example :
OUTPUTFORMAT
NAME pdf
DRIVER "CAIRO/PDF"
MIMETYPE "application/x-pdf"
IMAGEMODE RGB
EXTENSION "pdf"
FORMATOPTION "GEO_ENCODING=ISO32000"
FORMATOPTION "METADATA_ITEM:CREATOR=MapServer, with GDAL trunk"
FORMATOPTION "METADATA_ITEM:PRODUCER=MapServer, with GDAL trunk"
END
Attached a mapfile and an associate shapefile that demonstrate the patch.
The following work :
shp2img -m demo_geospatial_pdf.map -o out.pdf -s 1024 1024 -i "application/x-pdf"
and
QUERY_STRING="map=demo_geospatial_pdf.map&SERVICE=WMS&request=GetMap&version=1.1.1&layers=demo_geospatial_pdf&styles=&srs=EPSG:4326&transparent=FALSE&format=application/x-pdf&width=1024&height=1024&bbox=2,48,3,49" REQUEST_METHOD=GET ./mapserv > out.pdf
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

