[cl-typesetting-devel] Empty pages, again

Edi Weitz edi at agharta.de
Thu Apr 21 22:39:28 UTC 2005


Hi!

I have again problems with PDFs that come out as empty pages on
Acrobat 7.  Here's a simplified version of the code:

  (use-package :typeset)

  (defun write-table (n)
    (let* ((tt::*default-font* (pdf:get-font "Helvetica"))
           (tt::*default-font-size* 24)
           content
           (margins (list 10 10 10 10)))
      (with-open-file (out "/shared/foo.pdf" :direction :output :if-exists :supersede)
        (with-document ()
          (setq content (compile-text (:font tt::*default-font* :font-size tt::*default-font-size*)
                          (dotimes (i n)
                            (insert-table "foo"))))
          (draw-pages content
                      :margins margins
                      :break :after)
          (pdf:write-document out)))))


  (defun insert-table (text)
    (table (:col-widths (list 155) :padding 0 :border 1)
             (row (:height 44)
                  (tt::add-table-cell
                   (make-instance 'tt::table-cell
                      :v-align :center
                      :content (compile-text (:h-align :center) text))))))

If I call (WRITE-TABLE 1) I get a page with one table that looks fine.
If I call (WRITE-TABLE 2) instead I get an empty page.

What am I doing wrong?

Thanks,
Edi.



More information about the cl-typesetting-devel mailing list