home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x.apps
- Path: sparky!uunet!utcsri!skule.ecf!torn!ryelect!elf
- From: elf@ee.ryerson.ca (luis fernandes)
- Subject: Re: Printing with X
- Message-ID: <1992Nov18.174951.15979@ee.ryerson.ca>
- Keywords: Printing
- Sender: news@ee.ryerson.ca
- Nntp-Posting-Host: brundel
- Organization: Ryerson Polytechnical Institute, Toronto
- References: <1992Nov15.204111.1121@news.columbia.edu>
- Distribution: USA
- Date: Wed, 18 Nov 1992 17:49:51 GMT
- Lines: 36
-
- ars@ebony.cc.columbia.edu (Ali R. Siddiqui) writes:
- >Hello all,
- >
- > I have been writing a program which displays a graph of statistics
- >on the screen now I need to add a print option to it and I was wondering
- >if any of you have had any experience with makeing a hardcopy on a ps
- >printer of the Graph which I am displaying in the window using Xdrawline.
- >
-
- A quick-and-dirty solution is dumping the window using xwd & xpr
- without user interaction.
-
- First define a couple of things, the name of the window you wish
- to dump & the name of the device to dump to.
-
- /* name of the application when iconified & on window*/
- #define APPNAME "statsgraph"
- /* Postscript LaserWriter*/
- #define PRINTERDEVICENAME "lw"
-
- Then bind the following function to a key or to a button (via a callback
- mechanism):
- void
- laser_window()
- {
- char sysbuf[256];
-
- sprintf(sysbuf,"xwd -name %s | xpr -device %s | lpr -P%s -h", APPNAME,
- PRINTERDEVICENAME, PRINTERDEVICENAME);
-
- system(sysbuf);
- }
-
-
- --
- luis fernandes <elf@ee.ryerson.ca>
-