[cl-typesetting-devel] Drawing multiple pages woes.

Erik Enge erik at nittin.net
Tue May 11 14:44:03 UTC 2004


(defun draw-page (content &key (width *letter-width*) (height 
*letter-height*))
   (let ((x 0)
         (y height)
         (dx width)
         (dy height))
     (pdf:with-page ()
       (pdf:with-saved-state
         (pdf:translate x y)
         (let ((box (typeset::make-filled-vbox content dx dy)))
           (when box
             (typeset::stroke box 0 0)))))))

I use it like this:

       (pdf:with-document ()
         (let ((content (typeset::compile-text () ...)))
           (dolist (box (typeset::boxes content))
             (declare (ignore box))
             (draw-page content)))
       ... write document to stream ...

For documents with one page, this works great.  For documents with more 
than
one page I consistently get 204 empty pages (except that the first page 
has my
logo and some headers... perhaps the first box or somesuch?).

I tried using (loop while (typeset::boxes content) do ...) as one 
suggested but that
ends up in what seems to be an infinite loop.

Any clues as to what I'm doing wrong?

Thanks,

Erik.





More information about the cl-typesetting-devel mailing list