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

Klaus Weidner kw at w-m-p.com
Wed May 12 01:00:22 UTC 2004


Hello,

I found the problem. The table was nested inside a "compile-text",
which does not handle the needed splitting. You need to run "draw-pages"
directly on the table. Yes, this is ugly and should be changed. 

Also, I strongly recommend using the higher-level "draw-pages" functions,
that at least would have raised a condition to indicate that it can't fit
the content on the current page.

I'd really like to take a shot at redoing the table logic, but am badly
out of time at the moment. 

-Klaus

(defun multi-page-hello-erik (&optional (file #P"/tmp/hello.pdf"))
  (with-document ()
    (let ((margins '(72 72 72 72))
	  (content-1
	   (compile-text () "This is before the table."))
	  (content-2
           (table (:col-widths '(100 200) :splittable-p t)
	     (header-row (:background-color :gray)
	       (cell () "table header"))
	     (footer-row (:background-color :gray)
	       (cell () "table footer"))
	     (dotimes (time 60)
	       (row ()
		 (cell ()
		   (paragraph () "test"))))))
	  (content-3
	   (compile-text () "And this is after the table.")))
      (draw-pages content-1 :margins margins)
      (draw-pages content-2 :margins margins)
      (draw-pages content-3 :margins margins))
    (when pdf:*page* (finalize-page pdf:*page*))
    (pdf:write-document file)))




More information about the cl-typesetting-devel mailing list