[gdal-dev] Handling pdfium build / integration

Even Rouault even.rouault at spatialys.com
Thu Sep 17 02:19:47 PDT 2015


Hi Brad,

> I note the recent addition of pdfium for PDF support (alongside podofo and
> poppler).
> 
> I'm a bit lost on which pdfium repo and branch to use, the best way to
> build and install pdfium library and headers, and (because of that), how
> to point the GDAL ./configure options to that install.

Did you read the directions at the bottom of http://gdal.org/frmt_pdf.html ? 
I'm aware they might be still scarse. If you have ideas (preferably expressed 
as a doc patch) to improve them, please do so.

> 
> I'm mainly interested in linux at this stage. Windows differences might be
> interesting later.
> 
> I originally did a build of the "upstream" pdfium (after checkout of the
> repo, and then the depot-tools, etc). It took a while, but appeared to
> succeed.
> 
> I assume that the "upstream" pdfium repo is *not* what I want, and that I'm
> meant to use either the "klokantech" or "rouault" repos that do not have V8
> javascript support:

You might use the upstream pdfium repo, but it has unnecessary dependencies for 
the need of the PDF driver. And the forked repos have tweaks to pdfium itself 
to make it more compatible as a library integrated with other libraries. In 
particular, it renames the symbol of pdfium internal libjpeg and libopenjpeg2 
to avoid runtime clashes with system libraries or GDAL own libjpeg.

> 
> https://github.com/rouault/pdfium
> https://github.com/klokantech/pdfium
> 
> Based on a manual grab of the build-lin.sh script (I forget which one I
> used - probably klokantech, but they looked very similar), I got what
> looked like a successful build.

The build branch in my repo has a few improvements in the build scripts.

> 
> However at this point I'm stuck. Which parts need to get installed for a
> system-wide GDAL install, and what is the recommended way to do that?

Basically if you download https://github.com/rouault/pdfium/blob/build/build-
lin.sh , run it, it will install pdfium to $HOME/pdfium/install

> 
> After that, I'm hopeful that the ./configure options will be obvious.
> However if there is anything subtle, please feel free to point that out!
> 

And the GDAL configure to run is: ./configure --with-pdfium=$HOME/pdfium/install

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list