[cl-typesetting-devel] Empty pages, again

Jeff Caldwell jdcal at yahoo.com
Fri Apr 22 07:13:48 UTC 2005


--- Edi Weitz <edi at agharta.de> wrote:
> Hi!
> 
> I have again problems with PDFs that come out as empty pages on
> Acrobat 7.  Here's a simplified version of the code:

It's the padding and border parameters causing the problem, I think.
The following code works OK for me.

;;;; cl-typesetting-devel 20050421 Edi Weitz
;;;; changes by JDC investigating the problem Edi reported

;;;; Acrobat 6.0 LWW 4.3
;;;; Acrobat 6.0 showed the same problems reported by Edi in Acrobat 7.0

(defpackage ts (:use :cl :cl-user :typeset))
(in-package :ts)

(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 "c:/tmp/foo.pdf" :direction :output 
                         :if-exists :supersede)
      (with-document ()
        (pdf:with-page ()
          (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 and :border are removed
    (row (:height 44)
      (tt::add-table-cell
       (make-instance 'tt::table-cell
                      :v-align :center
                      :content (compile-text (:h-align :center) 
                                 text))))))


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the cl-typesetting-devel mailing list