[cl-typesetting-devel] Empty pages, again

Dmitriy Ivanov divanov at aha.ru
Fri Apr 22 10:08:55 UTC 2005


Hello Edi,

| I have again problems with PDFs that come out as empty pages on
| Acrobat 7.  Here's a simplified version of the code:
| ...snip...|
|
| 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?

Nothing at the first sight. My version (LWW with opening the output stream
in binary mode) lookes as follows:

(defun write-table (n)
  (let* ((tt::*default-font* (pdf:get-font "Helvetica"))
         (tt::*default-font-size* 24)
         content
         (margins (list 10 10 10 10)))
      (tt:with-document ()
         (setq content (tt:compile-text (:font tt::*default-font* :font-size tt::*default-font-size*)
                         (dotimes (i n)
                            (insert-table "foo"))))
         (tt:draw-pages content
                        :margins margins
                        :break :after)
         (pdf:write-document
"e:/lisp/projects/cl-typesetting/examples/edi-foo.pdf"))))


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


It looks fine on AcrobatReader 5.1. The resulting pdf-file is attached.
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru
-------------- next part --------------
A non-text attachment was scrubbed...
Name: edi-foo.pdf
Type: application/pdf
Size: 1002 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cl-typesetting-devel/attachments/20050422/24becabf/attachment.pdf>


More information about the cl-typesetting-devel mailing list