[cl-pdf-devel] parsing pdf file meta info

Lui Fungsin fungsin.lui at gmail.com
Fri Nov 10 02:47:12 UTC 2006


On 10/14/06, Marc Battyani <marc.battyani at fractalconcept.com> wrote:
> There is already a pdf parser in cl-pdf that can do that. You can even write
> on it.
> Have you looked at it?

Hi Marc,

  Sorry I overlooked this. The first thing I did was to take a look at
example.lisp and see how this library can be utilized and then I
quickly drew a wrong conclusion...

I have a test pdf document that is 10.5" by 13" and I run the following code

(with-existing-document
    ("/tmp/test.pdf")
  (with-existing-page (0)
    (bounds *page*)))

and get

#(0 0 756 936)

Dividing the numbers by 72 I get the measurement in inches.

I assumed that 72 is the dpi.

Are all pdf document have a dpi of 72 (I guess not)?

If not, how can I retrieve this information? I searched dpi from the
source code and didn't find any reference to it. Maybe I'm using the
wrong term here...

I ran the example9 on a Xeon 2.8GHz linux box and it really took quite
a while... but the result is very pretty!
I was wondering if ex9.pdf is left out in the distribution
intentionally to test one's patience :-)

BTW I saw the following comment in pdf-template.lisp

;;;## Example Usage
;;; Try something like this after loading pdf-template.lisp:
;;; (pdf:test-template "/tmp/ex7.pdf" 1 "/tmp/template.pdf")

Can you include template.pdf in the example directory so I can try it
out and see what it does? PDF is really a huge beast for newbie like
me...

Thanks!



More information about the cl-pdf-devel mailing list