[mapserver-users] Large scale PDF output on Windows

Brent Fraser bfraser at geoanalytic.com
Fri Apr 25 11:30:13 EDT 2008


Kristian (and all),

  Back in 2005 I challenged one of our new engineers to create a 34 inch by 44 inch PDF map (with a graticule!) of a 
satellite image using Mapserver (v4.6).  There were several problems, the most serious in mappdf.c which uses an 8-bit 
GD library image format restricting the images inserted into the PDF to 8 bit only (although just prior to insertion 
they're converted to JPEG, a 24-bit format!).

   One of the other problems was memory usage.  Mapserver creates two or three copies of the image when rendering it to 
PDF (and at 300 dpi an RGB image of that size can be 500 mb).  But if your format is smaller than 34 x 44, it may not be 
a problem.

   If there's enough interest, I'd be willing to contribute the code changes he made if there's a Mapserver 
developer/committer willing to review, upgrade them to v5,and test (and it may require an RFC as there was a map file 
addition to OUTPUTFORMAT/FORMATOPTIONS, I think).

Brent Fraser

Kristian Thy wrote:
> On Thu, Apr 24, Flavio Hendry wrote:
>> Discussed the issue a while ago with Frank Warmerdam. He had less
>> problems on a LINUX System running on a 64bit machine (he supposes it
>> could go as high as 25'000 pixels). On Windows 32 it bangs at around
>> 10'000 to 14'000 pixels depending on content. Did not try on Windows 64.
> 
> Thanks to advice from the list, I now have huge orthophoto pdfs. But now
> I have another problem - using png output, I get nice 24 bit images, but
> my pdf output is dithered 8 bit. The relevant part of my map file:
> 
>     IMAGETYPE png24
>     OUTPUTFORMAT
>         NAME png
>         MIMETYPE "image/png"
>         DRIVER AGG/PNG
>         EXTENSION png
>         IMAGEMODE RGB
>         TRANSPARENT FALSE
>     END #outputformat
>     OUTPUTFORMAT
>         NAME pdf
>         MIMETYPE "application/x-pdf"
>         DRIVER pdf
>         EXTENSION pdf
>         IMAGEMODE RGB
>         FORMATOPTION "OUTPUT_TYPE=RASTER"
>         TRANSPARENT FALSE
>     END #outputformat
> 
> Removing the FORMATOPTION makes no difference.
> 
> 	http://quovadis.dk/dl/ortho.png
> 	http://quovadis.dk/dl/ortho.pdf
> 
> The commandline incantation used to produce the images:
> 
> 	$ shp2img -m ddo.map -o ortho.pdf -s 1654 1169 -l DDO -e 659000 6058000 663200 6060970 -i pdf
> 
> Does the pdf driver support 24 bit at all? Can I do 24 bit pngs and
> assemble the pdfs by hand?
> 
> \\kristian


More information about the mapserver-users mailing list