Tag Info

Hot answers tagged

15

There are two traditional printing interfaces in the unix world: lp (the System V interface) and lpr (the BSD interface). There are three printing systems available on Linux: the traditional BSD lpr, the newer BSD system LPRng, and CUPS. LPRng and CUPS both provide a BSD-style interface and a System-V-style interface. Nowadays, CUPS is the de facto standard ...


10

You can use vim. vim -c hardcopy -c quit /path/to/file This will print the file and quit immediately. By default, vim prints with syntax highlighting. If you need to print from stdout of some command, you can do this: cat some_file.c | vim -c hardcopy -c 'quit!' - If you want to save the .ps for later, you can do that by adding redirection to the ...


7

To get the effect you want, where you get a man page in a separate window with the view starting at the first page, add the following to your ~/.bash_profile: function man { mf=`mktemp /tmp/$1-formatted-XXXXXXXXX` /usr/bin/man -t "$@" | pstopdf -i -o $mf mv $mf $mf.pdf open -W $mf.pdf rm $mf.pdf } You can log out and back in to ...


6

The shortest path here is probably to use a2ps, it generates monospaced postscript by default. Depending on its setup, it will send the output directly to stdout or lp, override with -o. Also, a2ps recognizes several programming languages and pretty-prints them. a2ps -o output.ps infile.text Use --pro=color if color is available: a2ps --pro=color -o ...


5

Not sure about OSX, but hopefully it's Unix-y enough... In your $HOME/.bashrc add the following line: export MANPAGER=cat If you want all of your paging programs to act in this way, set PAGER instead. man will use MANPAGER if set, otherwise it falls back to PAGER, which if not set falls back to more.


5

Based on your sample input and output, I gather that columns of numbers are always separated by whitespace; you want to format each numeric column to a known fixed width; you want the same number of digits in each line in each given column; one column has a leading sign (space or -). This translates to the following awk script, which applies a printf ...


5

You have to configure CUPS. Open the CUPS web interface at https://localhost:631 and click on "Add Printer" (don't be scared if it takes a while, it's scanning the network for network printers). If it does not automatically list your printer you can choose "Windows Printer via SAMBA". As URL enter: smb://[workgroup/]server[:port]/printer (workgroup and ...


5

Have a look at the files in /etc/cups. I don't have a Fedora 15 system to hand - but looking at a recent RHEL box, the relevant bits are in /etc/cups/cupd.conf .... # Administrator user group... SystemGroup sys root .... # Restrict access to configuration files... <Location /admin/conf> AuthType Basic Require user @SYSTEM Order allow,deny ...


5

The print server running CUPS is the only machine that needs to have the drivers. Read about CUPS on Wikipedia for example - in Overview section it states this quite clearly : CUPS allows printer manufacturers and printer-driver developers to more easily create drivers that work natively on the print server. Processing occurs on the server, allowing for ...


5

The message (in English "egrep: Invalid range end") comes from a bug in a2ps. Its /usr/bin/texi2dvi4a2ps shell script calls egrep wrongly: Instead of echo "$command_line_filename" | egrep '^(/|[A-z]:/)' >/dev/null \ || command_line_filename="./$command_line_filename" it should be echo "$command_line_filename" | egrep '^(/|[A-Za-z]:/)' >/dev/null ...


5

You have 2 choices. Wireless USB Bridge You can either get a little wireless/USB device that will share the printer out via wireless. You then connect to it using IPP such as ipp://<ip address of wireless bridge>/USB_queue. A device such as this would be up to the task: NETGEAR PS121 USB 2.0 Mini Print Server. We use such a device where I work. ...


4

Inkscape can convert between various vector graphics formats, including SVG to PDF. Although it's normally a GUI application, it can run in batch mode without an X server available. inkscape --without-gui --export-pdf=foo.pdf foo.svg lpr foo.pdf Or if you want to print directly: inkscape --without-gui --export-pdf=/dev/stdout foo.svg | lpr Another ...


4

So far as I know (as a regular user of SCO Unix) the "@" and "%" prefixes have no meaning in SCO Unix and are probably something used by the ERP system. You can list printers using the command lpstat -pDl. If, as I suspect, you see lp5 and not %lp5 that would confirm that the prefix is something used by the application. I believe the printer interface ...


4

There is also Muttprint. It does support UTF-8 and its output looks decent by default. Muttprint seems to use LaTeX and seems to provide hooks for customization. Since I am printing mails from different environments I can't use a default printer. Thus I have set it up (via ~/.muttrc) to use a PDF viewer where I can dynamically select a printer: set ...


4

If your system has proper kernel modules loaded, it should be enough to run eject /dev/sr0 (assuming /dev/sr0 is the printer's virtual cdrom device - see dmesg to check this). You will probably need root privileges for that (run with sudo).


4

You can use lpoptions. See man lpoptions. The command looks like lpoptions -d myprinter and creates a line in ~/.lpoptions (or on some systems ~/.cups/lpoptions) like Default myprinter See Command-Line Printing and Options, section "Setting the Default Printer".


4

The fix is in the UDEV rule. Since it is not possible through standard ways. You just create an UDEV rule which would detect printer adding and then run lpadmin -p PRINTERNAME -v CONNECTION?serial= so printer would be automatically reconfigured to use another connection. P.S: I would give 300 of points if someone gave me right direction. I hope I will ...


4

As you've discovered, this method is suboptimal at best. In addition to the HTML you'll need at a minimum all images and CSS. You may also need all of the Javascript. And then there's the whole deal of rendering this mess. But for you there is good news in the form of a Command Line Printing extension you can install in Firefox. Then: firefox -print ...


4

You can use the vim editor to pretty print arbitrary files vim can read. Use the following to create a PostScript file. vim \ -c 'hardcopy > output.ps' \ -c quit <input_file> If you want a PDF file, add && ps2pdf output.ps to the command line. You can also write a small script that pastes the current clipboard content into a ...


4

How To Print a Selected Portion of a PDF File Using the native Adobe Acrobat Reader Make sure the basic toolbar is visible by right clicking on a blank area of the toolbar, and placing a check mark next to Basic if it is not already enabled. Find the "Snapshot Tool" on the Basic toolbar and select it. Drag a box around the area you want to print. A ...


3

There are several programs that pretty-print various programming languages to Postscript, which don't require any third-party software to run: a2ps enscript trueprint If you are willing to go via LaTeX, you have more options. Going via LaTeX is mostly useful if you want to include code and something else in the same document; otherwise it's overkill. ...


3

An alternative to the cups solution by fschmitt - for example if you only have some limited lpr available - is the command psselect. For example for manual duplex printing in a printer without a duplex unit: $ psselect -e -r < foo.ps | lpr $ # manually rotate pages by 180 degrees and reinsert $ psselect -o < foo.ps | lpr Well, only works if your ...


3

This question can't be simply answered. It usually means that something with your printing device driver is messed up. Any additional information? Most likely you are using CUPS. Did you have a look at the logfiles? /var/log/cups/ ? Maybe this will help you, to specify your questions. Try to do some printing at a low level to eliminate any error sources ...


3

If you're using Samba/CUPS as a print server for windows based clients then the clients will normally have drivers for that printer, although in some cases CUPS can do its own translation. For example, it is possible to set up ghostscript and render postscript to display on a non-PS printer, although the Windows clients would need a PS driver that plays ...


3

When called without any options, column makes each delimited strings align to the nearest TAB-STOP COLUMN. In a terminal, that is typically on every 8th character column.. Have a look at this example: Create a file (ztxt) containing some tab-character \t delimited strings, spread over 3 lines which end with newline-character \n: ...


3

You could try to make a backup of /etc/cups on the Debian system (to restore the old state, if it fails), and copy then these files from SUSE - except the ssl subdir. Be sure to take care on owner and permission issues (root/adm/lpadmin) while copying. Error messages are found in /var/log/cups/. In /etc/cups/cupsd.conf you may increase the LogLevel to get ...


3

(I don't quite penetrate the way these signatures work, so these are merely pointers...) Given a PDF file, pdfbook from the pdfjam tool set could be a one-stop solution to this problem, from the manpage: pdfbook makes 2-up versions of PDF files, with the pages ordered as signatures. It depends on pdflatex and the pdfpages LaTeX package (which you ...


3

Short answer Use -1 instead of --portrait. Slightly longer answer By default a2ps tries to put 2 pages on each sheet, this works best side-by-side and landscape, even if you rotate the page a2ps still tries to insert 2 pages. The answer is to give a2ps the -1 switch which instructs it to only have 1 page per sheet (3-9 are also valid number of pages).


3

See the pdfseparate and pdfunite commands from poppler-utils. The first to separate the pages from each document into individual files, and the second to merge them in the order you want in a new document. Also note that since scanners give you raster images anyway (which some like yours can concatenate into a PDF files), maybe you can configure it to ...


3

Basically, having lp (executed by ssh on the remote machine) read from STDIN which is provided outside the ssh-call like this should work: cat file-to-print | ssh user@remotehost "lp -" For more comfort, have a look at this guy's script that gives CUPS a sshlpr://-backend.



Only top voted, non community-wiki answers of a minimum length are eligible