[cl-typesetting-devel] Drawing multiple pages woes.
Marc Battyani
marc.battyani at fractalconcept.com
Wed May 12 08:29:43 UTC 2004
[I'm sorry but yesterday, I missed Erik's message with the example, so my
advice to try with the example was out of sync :(
I take this example as the test base now.]
Klaus Weidner wrote:
> 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.
In fact the problem is related to the fact that the table was not inline.
When a table is not inline, it is put in an hbox and the v-split function
will not split it.
So with (table (:col-widths '(100 200) :splittable-p 1 :inline t) the table
is split and there is no infinite loop.
The problem is that the split is not correct.
(defun multi-page-hello (&optional (file #P"/tmp/hello.pdf"))
(pdf:with-document ()
(let ((content
(compile-text ()
(vspace 100)
(table (:col-widths '(100 200) :splittable-p 1 :inline t) ;;; start
Erik changes
(dotimes (time 50)
(row ()
(cell ()
(paragraph () (put-string (format nil "test ~d"
time))))))) ;;; end Erik changes
:eol
(paragraph (:h-align :center :font "Helvetica-Bold" :font-size 50
:color '(0.0 0 0.8))
"cl-typesetting" :eol
(vspace 2)
(hrule :dy 1)
(with-style (:font "Times-Italic" :font-size 26)
"The cool Common Lisp typesetting system")
(vspace 50)
(with-style (:font "Times-Italic" :font-size 36 :color '(0.0
0
0.8))
(dotimes (i 100)
(put-string "Hello World!")(new-line)))))))
(loop while (boxes content) do
(pdf:with-page ()
(pdf:set-line-width 0.1)
(draw-block content 20 800 545 700))))
(pdf:write-document file)))
In the multi-page-example the table is correctly splitted though.
> 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.
Yes the lack of time is the major problem :(
Have you advanced the HTML renderer ?
Marc
More information about the cl-typesetting-devel
mailing list