View Full Version : Printing in X11 applications
Phil St. Romain
01-11-2003, 12:11 AM
I've searched for info on this and have found none. Is it possible to use my USB printer to print from an X11 application like AbiWord? When I choose File>Print, the printer setting is lp, which I assume means local printer? But that doesn't work.
Phil,
I haven't forgotten your problem with printing from AbiWord from your previous post. I didn't answer you before because I failed in all the attempts to make it work.
I myself had to ask advice, and it came from Martin Costabel (fink developer) who used his time patiently to test the possibilities. Here is the answer from Martin Costabel to my inquiry:
-----------------------
You wrote:
When I choose File>Print, the printer setting is lp, which I assume means local printer? But that doesn't work.
This is quite usual ("I try to print and it doesn't work"), and most of the time it happens I have no idea either.
You wrote:
Is it possible to use my USB printer to print from an X11 application like AbiWord?
You made me curious, and I gave it a try. Here is what I found:
AbiWord sends postscript files, which does not work with the cups printing system of OSX (maybe with the gimp-print addition, but I never tried this), at least if you print to a non-postscript USB printer, which is my case, and maybe also yours.
You first have to convert ps to pdf. This can be done using the ps2pdf command. So the first possibility is to print from AbiWord into a file, convert this to pdf using ps2pdf, and then print this pdf file from some other application, for example Preview.app, or from the command line using
lpr -P'YOURPRINTERNAME'
The second possibility which I just got to work, is to do this directly in the print command line in AbiWord's print dialog. I'll give the example that worked for me. Modify it for your needs:
Instead of the 'lpr' that is written there by default, I put
ps2pdf - - | lpr -PDESKJET_960C@192.168.1.6
Note the two dashes, separated by spaces.
The name of the printer that appears here is exactly as it is given by 'lpstat -a'. In my case, it is a USB printer attached to an iMac to which I am connected over AirPort, and printer sharing is switched on on the iMac.
------------------------
Hope this helps you too.
Cheers...
Phil St. Romain
01-11-2003, 04:49 PM
I'll give it a try, sao. Thanks a lot for checking into this.
We're discussing a possible X11 forum in the xhints feedback forum. This is the sort of thread that we'll move there, if we go with it.
I also think we'd do well to start some kind of FAQ page somewhere for the most common questions: e.g., how to get X11 going with Fink, how to launch apps, etc.
I opened a word doc from work with Openoffice on my powerbook. I clicked the print icon and to my surprise it printed on the
usb printer attached to my powermac 2 floors down. Everything just worked. Way too cool!
Joe
Phil wrote:
I also think we'd do well to start some kind of FAQ page somewhere for the most common questions: e.g., how to get X11 going with Fink, how to launch apps, etc.
Good idea. I have started a thread "FAQ for Apple X11 Public Beta" were I will be adding useful tips, here:
http://forums.macosxhints.com/showthread.php?s=&threadid=8446
Cheers...
Phil St. Romain
01-15-2003, 10:52 PM
Sao, I tried the ps2pdf command in AbiWord, but no-go.
I'm also unable to print in OpenOffice, although it seems that others can do so. OO shows my printer listed, but when I try to do so, nothing happens.
Anyone have any ideas about this?
HP Deskjet 930
rusto
01-15-2003, 11:08 PM
Just tried printing to my Epson Stylus 740, showed as "Generic Printer" in OpenOffice...it worked!
Phil,
What is ghostscript:
Ghostscript can read a PostScript or PDF file and display the results on the screen or convert them into a form you can print on a non-PostScript printer. Especially together with several popular previewers, with Ghostscript you can view or print an entire document or even isolated pages, even if your computer doesn't have Display PostScript and your printer doesn't handle PostScript itself.
Previewers:
% fink list gv
Information about 2073 packages read in 2 seconds.
i gv 3.5.8-5 X11 interface for ghostscript interpreter
i mgv 3.1.5-4 Motif PostScript viewer loosely based on Ghostview 1.5
Did you installed ghostscript with Fink?
% fink list ghostscript
Information about 2073 packages read in 1 seconds.
ghostscript 8.00-1 Interpreter for PostScript and PDF
i ghostscript-fonts 6.0-3 Standard fonts for Ghostscript
ghostscript-nox 8.00-1 Interpreter for PostScript and PDF
i ghostscript6 6.01-2 Interpreter for PostScript and PDF, v6.01 (used with teTeX)
ghostscript6-nox 6.01-3 Intrp. for PostScript/PDF, v6.01 (for teTeX), no X11 support
system-ghostscript 7.05-2 Placeholder package for manually installed ghostscript
system-ghostscript6 6.01-1 Placeholder package for manually installed ghostscript
x-ghostscript-fonts 20020206-3 Allows ghostscript fonts to be used within X-windows
ps2pdf is implemented as a very small command script (batch file) that invokes Ghostscript, selecting a special "output device" called pdfwrite.
run in terminal.app:
% which ps2pdf
/sw/bin/ps2pdf
Let me know.
Cheers...
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.