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

Printing Pics

I try to use the following code to print pictures to a laserwriter. The
code is an adaption of the hardcopy.lisp file long time ago bundled with

The code works wonderfully when I disable Background Printing on
laserwriter driver 8.1.1 but crashes violently after printing the picture
if it is enabled.

I also tried the print-u package on cambridge.apple.com but the code looked
equivalent and also crashed my mac quite often.

Any hints ?

(defun b-print-picture (picture x y)
  (let ((pRec (make-record :TPrint)))
      (with-cursor *arrow-cursor*
        (when (#_prstldialog :ptr pRec :boolean)
          (when (#_PrJobDialog :ptr pRec :boolean)
              (let ((hardcopy-ptr (#_PrOpenDoc :ptr pRec :long 0 :long 0
                    (with-dereferenced-handles ((ppRec pRec))
                          (#_PrOpenPage :ptr hardcopy-ptr :long 0)
                          (with-port hardcopy-ptr
                            (#_moveto 0 0)
                            (ccl::with-rectangle-arg (r 0 0 x y)
                              (#_DrawPicture picture r)
                          (#_PrClosePage :ptr hardcopy-ptr))
                  (#_PrCloseDoc :ptr hardcopy-ptr))
              (when (eq (href pRec :TprJob.bJDocLoop)
                (rlet ((StRec :tprstatus))
                  (#_PrPicFile :ptr pRec :long 0 :long 0 :long 0 :ptr
      (dispose-record pRec)