Skip to Content.
Sympa Menu

baslinux - Re: [BL] HTML to PDF/PS (was: BL3 as 'user') 14

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: sindi keesan <keesan AT sdf.lonestar.org>
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] HTML to PDF/PS (was: BL3 as 'user') 14
  • Date: Mon, 22 Jan 2007 19:06:32 +0000 (UTC)

On Mon, 22 Jan 2007, James Miller wrote:

On Mon, Jan 22, 2007 at 06:40:33AM +0000, sindi keesan wrote:

Opera will save as HTML or plain text, but not as ps. To print webpages

If Opera works like Firefox/Mozilla--and Steven's recent post makes me think it does--you don't "save as" to get a ps file of the web page you're viewing. Instead, you select "Print" from the "File" (or Opera's equivalent) menu. Then,

Yes, I can check off Print to File and fill in a file name (there is no default name). It printed a gs-readable .ps file complete, with URL at bottom left. I could then use a little script I wrote which prints directly to /dev/lp0 from the command line, as root, without lpr.
This is fine for me, but might be tricky for other people who have not used linux and just want to print webpages.

Abiword also just printed Untitled.ps file after I told it to print to file instead of to printer (and it greyed out the lpr print command). In theory (according to wvware page) Abiword can convert WORD to html or ps on the command line. Maybe also from html to ps?


you should be able to check a box in the resulting print dialog window that says something like "Print to file." You may additionally need to select a postscript printer or postscript output from a printer drop-down menu in the print dialog window. You then give a name for the file to be printed, and perhaps select a location for it. In Firefox, I need to specify the .ps extention, since the ps print routine doesn't add it.

James

So now I can produce ps files on the internet or from a wordprocessor and print them with gs CLI. There is no need for pdf in this case since I can print ps, but I tried to produce it anyway:

ps2pdf (that I compiled as part of gs 8.50) is not working.
unknown device: pdfwrite
Unrecoverable error: undefined in .uninstallpagedevice
Operand stack: default device

I did not compile pdfwrite as a device.

Same problem with the GS 5.10 (SW7.1) ps2pdf.
The SW4.0 version sort of works but can't find the proper fonts.

They both have pdfwrite as a device. What I compiled does not.
The 5.10 version is probably confused by something in my version (which I should recompile some day).

But I can print ps files without lpr, CLI, and so I tried substituting the script to do that as the print command or printer program.

As root:

insmod parport
insmod parport_pc
insmod lp

As printer program:
/usr/local/sbin/printdeskjetd

That works outside of Opera in a terminal but did not work in Opera.

gs -q -dSAFER -sDEVICE=deskjet -r150x150 -sPAPERSIZE=letter -sOutputFile=- - < $1> /dev/lp0

did not work either in Opera, nor did putting gs on the first line and the rest of the stuff under parameters.

Can someone else make this work, without lpr?


I have succeeded in printing from Opera as 'user':

rxvt and xterm have identical permissions: -rws--x--x

rxvt: Failed to open input method
can't open pseudo-tty

(There is a 2004 discussion of this in the archives and I think it worked properly in BL3 once it was made executable).

I changed /home/user/.xinitrc to use xterm instead of rxvt.

Then Opera could not write to /dev/null so I chmod 777'd it to make it writeable by user.

Then opera started to load but:
Qsettings: error creating /home/user/.qt

/home/user was drwxr-xr-x

chmod 777 /home/user changed it to drwxrwxrwx
(and now I can also write to other files in the user directory).

Opera is now working for user. I can copy over /root/.opera to /home/user/.opera to restore preferences, along with all other hidden files starting in . and /.links/*.

To print with lpr (including in opera, abiword, or xpdf):

As root:
insmod parport insmod parport_pc
insmod lpd - run lp daemon before running lpr
lp

As user:
lpr filename.ps (or print from within Opera or Abiword)

Useful commands (they work for user or root):
lprm - remove everything from the print queue owned by user
lpq - no entries in queue (or lists the entries)


In /etc/printcap (which I posted at my site for several printers)
the default is 300x300 dpi deskjet 500 and 600 series, 850 and 870 and 900 (not 722 or 820 which are ppa printers) lp is the default (deskjet 300 dpi) so I don't need to change Opera settings to print to it, or to specify another printer program (default is lpr).

Opera correctly printed a page on my 672C (in mono, which is all the gs deskjet device does, otherwise I could have specified to print mono if I used a different gs printer device that also does color).

As 'root' it still does not print with lpr and the same defaults.
I will attempt to understand David's explanation of this next.

Does /user/ have to reside in /home/user or will just /user work?

Sindi




Archive powered by MHonArc 2.6.24.

Top of Page