[gdal-dev] Something wrong with writing a big raster into PDF

Even Rouault even.rouault at mines-paris.org
Fri Mar 7 12:15:02 PST 2014


Le vendredi 07 mars 2014 21:11:40, Even Rouault a écrit :
> Le vendredi 07 mars 2014 14:20:13, Rahkonen Jukka (Tike) a écrit :
> > Hi Even,
> > 
> > Yes, that way I can perhaps create an all-white PDF map a bit faster but
> > with no other improvement, unfortunately.
> 
> I've tried "gdal_translate UM5L.png UM5L.pdf -of pdf" on my Linux
> workstation and the the following viewers :

I forgot to mention the "-co TILED=YES" which was actually used and makes a 
dramatic improvement for xpdf & QGIS use cases, compared to not tiling mode.

> - Adobe Reader 9.4.2 Linux: blank image
> - Okular, KDE-based PDF viewer, based on poppler library: can display a
> fit-to- page overview in a few seconds, but not the full resolution image
> since it tries to allocate a 15360x15360 buffer
> - Evince, GNOME-based PDF viewer, based on poppler library, uses cairo for
> display: blank image with error message "cairo context error: out of
> memory" - xpdf, viewer whose code has been forked to build the poppler
> library: can display the PDF at full resolution, and in reasonable time.
> - qgis (based on GDAL PDF driver, and poppler backend) : the initial
> overview computation is really really slow. Roughly half an hour. Because
> there's currently no optimization in the GDAL PDF reader to get a lower
> resolution image. Could potentially be dramatically improved by asking a
> rendering at lower DPI for overview levels, instead of querying at best
> DPI and then downsampling. But once that 32x32 overview is computed, if
> you go to 100% scale and pan, the refresh time is around 1 second after
> each pan. - command line "rendering" (based on GDAL PDF driver, and
> poppler backend) : gdal_translate UM5L_tiled.pdf out.tif -co TILED=YES : 1
> minute 20 sec (less if you specify a higher value than the default for
> GDAL_CACHEMAX)
> 
> I've also tried generating a JPEG2000 compressed PDF and Adore Reader is
> not happier.
> 
> Conclusion: most PDF viewers assume that a PDF page can fit in memory and
> don't use a tiling strategy to display it.
> 
> Even

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html


More information about the gdal-dev mailing list