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 ...


11

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 ...


7

The shortest path here is probably to use a2ps, it generates monospaced postscript by default. You can install a2ps with brew, i.e. brew install a2ps 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 ...


6

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 ...


5

Try lpr -o page-set=odd <file> lpr -o page-set=even <file> You can find the documentation of this and other lpr options in the cups documentation.


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

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

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

I haven't tested this, but this should work: cd some-directory for file in *.pdf ; do lp -n2 # number of copies -o media=a4\ # media -o number-up=2\ # number of pages per sheet -o fit-to-page\ # scale to page -o sides=two-sided-long-edge\ # duplex (can be 'one-sided') ...


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. ...


5

To cancel a print job : List all jobs: lpq Rank Owner/ID Class Job Files Size Time active bob A 11 zarma.txt 8000 10:12:10 Delete the job by it's id, which is 11 here: lprm 11 You must be root to delete jobs that you don't have initiated. If the printer is not the default printer, add the -P option, ...


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

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

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. ...


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

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: ...


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

Page handling is determined by the application, not the printer. If this functionality is important to you and not present in Zathura you could use a more fully-featured .pdf reader like Evince.


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 ...


4

The MIME type is sent in the IPP attribute document-format, which you can specify with the -o option: lpr -o document-format=text/plain ... Note that if you try a document format that your CUPS server doesn't support, you'll get an error: $ lpr -o document-format=image/svg+xml drawing.svg lpr: Unsupported document-format "image/svg+xml". That error is ...


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

You can configure CUPS defaults for your account by running the lpoptions command. Run lpoptions -l to see what options are available for your printer, and determine which one corresponds to the color/monochrome choice. For example, with this output $ lpoptions -l | grep Color ColorModel/Color Model: Gray Black *RGB CMY CMYK KCMY I would set ColorModel to ...



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