[poppler] Trying to extend pdftoppm to use CairoOutputDev

Adrian Johnson ajohnson at redneon.com
Fri Dec 18 02:46:55 PST 2009


mpsuzuki at hiroshima-u.ac.jp wrote:
> Thank you, I'm not sticking to the idea putting everything
> into pdftoppm. Making a program using only cairo output is
> better because the source code is shorter & cleaner.
> 
> However, yet I'm not sure how to use pdftocairo to crop PDF.
> 
> The sample source including 8 figures:
> 
>   http://home.hiroshima-u.ac.jp/mpsuzuki/tibetbt-chart.pdf
> 
> The pdf cropped by pdftoppm with my patch is
> 
>   http://home.hiroshima-u.ac.jp/mpsuzuki/cropped-pdftoppm.pdf
> 
> It was cropped aslike:
> 
>   pdftoppm -pdf -f 1 -l 1 -r 72 -x 80 -y 80 -W 215 -H 160 \
>     tibetbt-chart.pdf cropped-pdftoppm
> 
> The pdf "cropped" by pdftocairo is
> 
>   http://home.hiroshima-u.ac.jp/mpsuzuki/cropped-pdftocairo.pdf
> 
> It was "cropped" aslike:
> 
>   pdftoppm -pdf -f 1 -l 1 -r 72 -x 80 -y 80 -W 215 -H 160 \
>     tibetbt-chart.pdf cropped-pdftocairo.pdf

I assume you meant "pdftocairo" instead of "pdftoppm". The resolution 
option "-r" is not required (and doesn't do anything) when using -pdf or 
-ps.

> It seems that the origin specified by -x & -y are reflected,
> but the output is full sized, not cropped. What was wrong?

Probably a bug. I copied pdftoppm.cc to create pdftocairo.cc so all the 
relevant options were copied across. However many of the options have 
not been tested as I only use pdftocairo for my testing purposes.

Patches are welcome.



More information about the poppler mailing list