[cl-typesetting-devel] page breaks using draw-pages
Jonathon McKitrick
jmckitrick at reedlarkeygroup.com
Sat Feb 24 20:17:16 UTC 2007
Here's some code:
(defun add-par ()
(paragraph (:font "Times-Roman" :font-size 24)
"old page")
:eop
(paragraph (:font "Times-Roman" :font-size 24)
"new page"))
(defun report-write-to-file (filename)
(tt:with-document ()
(let* ((header (lambda (pdf:*page*)
(compile-text () "Header")))
(footer (lambda (pdf:*page*)
(compile-text (:font "Times-Roman" :font-size 12)
(paragraph (:h-align :center)
(verbatim (format nil "~D" pdf:*page-number*))))))
(content
(compile-text () (add-par))))
(draw-pages content :margins '(108 72 72 72) :header header :footer
footer)
(when pdf:*page* (finalize-page pdf:*page*))
(pdf:write-document (concatenate 'string "web/data/" filename)))))
What I need to be able to do is generate content via function calls, since
there is too much to fit into just this function. But those function
calls need to be able to generate page breaks. In this example, 'add-par'
is not able to create a new page.
--
Jonathon McKitrick
Reed Larkey Group
More information about the cl-typesetting-devel
mailing list