[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: landscape printing

on Fri Jan 29 19:32:09 1993 you replied to a query from
hinkle@rddvax.decnet.lockheed.com about setting the page
setup attributes to landscape or portrait, noting:
  sorry I don't have the lisp code for checking handy,
   but here's how to check in pascal:
Gregory Wilcox sent me some code for setting the correct bits 
in a printer record to landscape or portrait.  Here's the code
which I have not yet integrated into print-u.lisp.

The following method sets the orientation to landscape
when orientation is 0 and to portrait when it is 1.
(defmethod set-print-orientation ((self t) orientation)
  (with-open-printer (print-record :view self)
    (if (macptrp print-record)
      (let* ((old (rref print-record :tprint.prstl.wdev))
             (bit (ecase orientation
                    (landscape 0)
                    (portrait 1)))
             ;; experimentally determined that bit one controls orientation
             ;; is this always true?
             (new (dpb bit (byte 1 1) old)))
        (rset print-record :tprint.prstl.wdev new))
      (error "~s is not a macintosh pointer" print-record))))