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

Hardcopy of graphics

At  5:28 AM 6/28/93 +0000, Christopher J. Vogt wrote:
>I need to be able to hardcopy some graphics that I am creating.  Is
>there anything available that does this?
>I imagine that if I had the hardcpy source code, I could modify
>it to do this for me, is the source code available?

Mark Tapia's print-u package will probably do what you want.

The source for MCL's printing code (sans patches) is in the file:
  MCL 2.0 CD:Additional MCL Source Code:lib:edhardcopy.lisp

Here is some mail about the print-u package:


From: "Mark A. Tapia" <markt@dgp.toronto.edu>
To: info-mcl@cambridge.apple.com
Subject: Printing thin lines
Message-Id: <93Feb9.192052est.144068@explorer.dgp.toronto.edu>
Date:   Tue, 9 Feb 1993 19:20:43 -0500

I've downloaded the latest version of print-u.lisp.hqx to
cambridge.apple.com into pub/MCL2/contrib.

This version of print-u supports the postscript setLineWidth
command. This allows you to create pictures with linewidths
that are scaled, resulting in thin lines when displaying 
the pictures on PostScript devices.


From: "Mark A. Tapia" <markt@dgp.toronto.edu>
To: info-mcl@cambridge.apple.com
Subject: New version of print-u
Cc: bill@cambridge.apple.com, cartier@uqam.montreal.ca, straz@cambridge.apple.com, wilcox@cmns.think.com
Message-Id: <92Oct29.173736est.144079@explorer.dgp.toronto.edu>
Date:   Thu, 29 Oct 1992 17:37:34 -0500

I've uploaded a new version of print-u.lisp in binhex format
at cambridge.apple.com in:
Print-u supports generalized printing routines for 
windows, pictures and other objects. 

The previous version supported only two print styles:
one for fred windows and one for all other objects.
The new version contains support for private print records
which contain the printing style for an object.

With the new version you can associate a different print style
with each window and print the window using that style
without changing the Page Setup attributes.

Since the print style attributes for fred-windows are saved with the file,
the print style will be reloaded when the file is reloaded
and will not affect other windows.

;; NOTE: Every window has a private print record which controls the
;;       way the window will be printed and the attributes in the
;;       print-style-dialog box. The private print record is stored in the
;;       resource fork of the file when it is saved (:type :prec :resource-d 128)
;;       and when the Page Setup method is selected.
;;       The private print record is restored when the file is edited again.
;;       Every specific view uses the private print record of the outermost
;;       view containing the specific view.
;;       A private print record of a window is saved when the window
;;       is saved (using Save, Save As, or Save Copy As and when the
;;       window is closed and needs to be saved. Methods are defined
;;       for fred windows.
;;       For all other windows, you must provide a method for saving
;;       the file (ccl::window-save using ccl::window-file-save which
;;       must return the pathname) and a method for (view-file-name window)
;;       When a titled fred-window is saved (using the file menu
;;       items "save", "Save As ..." "Save Copy As..."), the page 
;;       setup attributes are saved in a print record in the file. 
;;       The record is placed in the :prec resource with id 128.  
;;       When the file is reopened in a fred-window, the page setup 
;;       attributes are restored.
;;       Every other object uses a shared, public print record *print-hc-prec*.
;;       This print record is initialized at the beginning of a session.

From: "Mark A. Tapia" <markt@dgp.toronto.edu>
To: wilcox@cmns.think.com
Subject: Re:  window-hardcopy for 'window
Cc: bill@cambridge.apple.com, info-mcl@cambridge.apple.com
Message-Id: <92Jul14.184930edt.144415@explorer.dgp.toronto.edu>
Date:   Tue, 14 Jul 1992 18:49:23 -0400

Greg Wilcox (wilcox@cmns.think.com) writes:
  Does anyone have a definition for the following function?
 (defmethod window-hardcopy ((self window) &optional (print-dialog? t))

You're in luck. I spent some time developing a general set of printing
utilities. Bill St. Clair and Steve Mitchell both helped me to
get the code not to hang.  The code can run with MCL 2.0b1p3 and
MCL2.0f3.  The code is in
The code supports printing various objects, including windows,
pictures, and generalized documents.

I've tested the code by producing both hardcopy (on a QMS laser printer)
and Post Script files. I have not tested it on other printers at
other settings. 

You're welcome to use the code and "debug" it for me, since Bill
St. Clair is swamped.


The following is extracted from the documentation in the

 The following methods and functions are exported:
        picture-hardcopy   for quickdraw pictures
        print-contents     for drawing the nested views of a window
        get-printer-error  for returning the error condition or nil (no error)

 Internal (unexported) routines of interest
        document-hardcopy  for printing a general document
        window-hardcopy    for printing the contents of a window using

With this package you can print a picture by
   (picture-hardcopy a-picture-handle)
To print the contents of a window:
    (print-contents window)
    or select the window and issue the File menu Print command

Print-contents supports the following types of views:
    window                    - draws a box around the content area
                                of the window and prints the contents
                                of the subviews.

    static-text-dialog-item   - draws a box around the item
                                and prints the text with the view font

    editable-text-dialog-item - draws a box around the item
                                and prints the text with the view font

    button-dialog-item        - draws the button and the text within

    view                      - prints the contents of the subviews

    sv                        - does nothing