[poppler] Trying to extend pdftoppm to use CairoOutputDev

mpsuzuki at hiroshima-u.ac.jp mpsuzuki at hiroshima-u.ac.jp
Thu Dec 17 21:38:29 PST 2009


Hi,

Before all, I'm sorry for my poor English and I thank
Stefan for the description what I wanted to do.

On Thu, 17 Dec 2009 21:35:45 +1030
Adrian Johnson <ajohnson at redneon.com> wrote:
>I have a pdftocairo util that I use for testing. This may be a better 
>way of exposing the cairo png/ps/pdf output.
>
>http://people.freedesktop.org/~ajohnson/0001-Add-pdftocairo-util.patch

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

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

Regards,
mpsuzuki


More information about the poppler mailing list