[cl-typesetting-devel] Need help with layout

jcm at SDF.ORG jcm at SDF.ORG
Wed Jan 18 20:32:45 UTC 2012


> What you want to do exactly is not clear. Why don't you draw those
> labels in the drawing function of your user-drown-box?
> The best way for you to get real practical help would be to post a small
> simple and self contained example showing your problem.

I found the best solution here is a table, and that is working very well.

But now I trying to get footers to appear on a landscape style document.

Here's a trimmed down but functional snippet:

(with-document ()
    (let* ((header
             (lambda (pdf:*page*)
               (pdf:translate 0 580)

               (pdf:set-rgb-fill 0.55 0.17 0.08)
               (pdf:set-rgb-stroke 0.55 0.17 0.08)
               (pdf:basic-rect 0 0 841 15)
               (pdf:fill-and-stroke)

               (pdf:set-rgb-fill 0.70 0.22 0.11)
               (pdf:set-rgb-stroke 0.70 0.22 0.11)
               (pdf:basic-rect 0 3 841 9)
               (pdf:fill-and-stroke)

               (pdf:set-rgb-fill 0.78 0.24 0.12)
               (pdf:set-rgb-stroke 0.78 0.24 0.12)
               (pdf:basic-rect 0 6 841 3)
               (pdf:fill-and-stroke)

               (compile-text ())))
           (footer
             (lambda (pdf:*page*)
               (compile-text (:font *font* :font-size 10)
                 (paragraph (:h-align :left :color '(1 0 0))
                   "Company name")
                 (paragraph (:h-align :center :color '(0 0 0))
                   (verbatim (format nil "~D" pdf:*page-number*))))))
           (content
             (compile-text (:top-margin 20 :font *font* :font-size
*font-size*)
               (paragraph
                   (:h-align :left :font "Times-Roman" :font-size 36
:color '(0.8 0.25 0.12))
                 "Report"))))
      (draw-pages content
                  :orientation :landscape
                  :margins '(72 36 72 36)
                  :header header
                  :footer footer
                  :break :always
                  )
      (pdf:write-document filename)))

Thanks for your help!





More information about the cl-typesetting-devel mailing list