USING PRINT FILES


PRINT FILE PRINTS GARBAGE

The Annoyance:

I needed to print a report from our accounting software application at work. The printer was down, and I didn't want to wait for the repairs to be completed, so I chose the Print to File option on the Print dialog box. I emailed the print file to my home email address. When I got home, I sent the file to my printer using the correct copy command. The printer spewed out pages and pages of garbage characters, along with a small amount of text from the report. Why doesn't this work properly?

The Fix:

Your work printer is a different model than the one you have at home. Print files don't work unless you send them to the same printer model you selected when you opened the Print dialog box. The codes in the print file are specific to, and proprietary for, the printer you selected when you created the file.

To create a print file that you can successfully print at home, install your home printer on your computer at work. Make it a local printer and assign LPT1 as the port. Then, select that printer when you print the document to a file. Don't worry, Windows doesn't peek through the monitor and say, "Hey, I don't see an inkjet printer, so I'm not going to install this driver." If a local printer already exists on your work computer, it's OK to install two printers to LPT1; Windows won't blink an eye. At home, copy the .PRN file to LPT1 with the /b parameter (see the sidebar "Understanding Print Files").

PRN files are not the best way to transfer information. They're enormous (all those codes!) and they're printer-specific. Sometimes, however, they seem to be the only choice you have if the software you used to produce the document isn't installed on the computer from which you want to print the document.

UNDERSTANDING PRINT FILES

The Print dialog box has a Print to File box. If you check the box and then click Print or OK (depending on your version of Windows), you're prompted to enter a filename for the file. Windows automatically adds the file extension .PRN, which indicates a print file. A print file is a binary file that contains all the text in the document you're printing, along with all the binary codes the printer needs to print the file. Those codes include formatting codes (bold, fonts, font sizes, paragraph breaks, etc.), as well as commands for printing the document, such as End-of-Page codes.

Use the following command to print the file from the command line:

copy /b DocumentName.prn LTP1

Here's the breakdown of the command:

  • You use the copy command because it's the only way the operating system lets you send a print file to a printer.

  • The /b parameter after the copy command tells Windows this is a binary file.

  • Substitute the name of the print file you chose for DocumentName (don't forget the .prn extension).

  • LTP1 is the name of the port where you connected the printer. If your computer has two parallel ports, make sure you send the command to the correct port (LPT2, for example).


PRINT FILES THAT WORK EVERYWHERE

The Annoyance:

I used some software at a friend's house to analyze my financial position. The software (which I don't own and don't want to purchase) displayed a very interesting report that I wanted to keep so that I could refer to it in the future. I couldn't print it because my friend's printer was broken. Is there a solution to this dilemma?

The Fix:

There's a nifty solution, and it's a great solution for the previous annoyance about print files, too. Use a plain-text print file, so you can use it on any printer and any computer. You'll lose any formatting in the document, but you'll retain the information. Of course, because print files are matched to specific printers, this means you have to install a printer that prints plain text.

Guess what? Windows has a plain-text printer. To install it, open the Printers folder and start the Add Printer Wizard. Step through the wizard, using the following guidelines (the order in which the wizard windows appear might be different, depending on your version of Windows):

  1. Specify a local printer.

  2. Uncheck the "Automatically detect and install my Plug and Play printer" box (because there isn't a text printer plugged into any of the ports).

  3. Select FILE: (Print to File) as the port.

  4. In the Manufacturer list, select Generic.

  5. In the Printers list, select Generic/Text Only.

  6. Use the default printer name (Generic/Text Only).

  7. Don't make this printer the default printer.

  8. Don't share the printer.

  9. Don't print a test page.

To print a document, select the Generic/Text Only printer in the Print dialog box. You don't have to check the Print to File box because the printer is already configured to print to a file. Just click the Print button (or the OK button, depending on your version of Windows).

The Print to File dialog box opens, allowing you to enter a filename. The dialog box differs among different versions of Windows. However, all versions of Windows save the file either to your My Documents folder or to the subfolder you're currently working in.

In Windows XP, the Print to File dialog box merely asks for the filename (see Figure 5-14). I usually add an extension, so that when I copy it to my own computer I can double-click the file in Windows Explorer or My Computer and have it open automatically in the software of my choice. For example, if I know I want to use Notepad to view and print the file, I add the extension .txt to the filename. If I'm planning to open the file in Microsoft Word, I add the extension .doc to the filename.

Figure 5-14. Name the text print file to suit your own needs.


In earlier versions of Windows, the Print to File dialog box assumes this is a standard print file and automatically enters the file extension .prn. Enter a filename and replace .prn with a different extension, or delete the .prn extension and use a filename without an extension.

You can load this file into any word processor or WordPad (and format it, if you like), or into Notepad (if you don't mind keeping it unformatted). You can also copy it directly to the printer from the command line using the following command: copy filename lpt1. You don't need the /b parameter for the copy command because this isn't a binary file (it has no printer codes).


Tip: It's a good idea to install the generic text printer on every computer on your network. It's surprising how often it comes in handy.


    Home Networking Annoyances
    Home Networking Annoyances: How to Fix the Most Annoying Things about Your Home Network
    ISBN: 0596008082
    EAN: 2147483647
    Year: 2006
    Pages: 90
    Authors: Kathy Ivens

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net