============================== How to print things in NET2003 ============================== -IAN! idallen@idallen.ca Index to this file: * Printing Unix/Linux Text Files from Windows * Printing from Knoppix in Algonquin Lab T111 * Printing files from ACADUNIX The Algonquin College ITS department has little experience with Unix/Linux in the classroom, so printing from Unix/Linux is not supported. Often the easiest way to get something printed is to copy it from Unix/Linux to some Windows machine and then print it from there using the existing Windows software that ITS knows how to support. See the file_transfer.txt file for details. ------------------------------------------- Printing Unix/Linux Text Files from Windows ------------------------------------------- When copying a text file from a Unix/Linux machine to Windows, it helps to name the destination file with a ".txt" suffix so that Windows can recognize it as a text file; make sure the file on Windows ends in ".txt". Rename the file on Windows if necessary. Text files from Unix/Linux may not print properly on Windows due to the Microsoft choice of incompatible line end characters. Unix uses Line Feed [LF or '\n'] characters for line end and Windows requires both Carriage Return [CR or '\r'] and Line Feed characters. For this reason, "Notepad" does not handle Unix text files well; try opening the file using "Write" or "Wordpad" (or even "Word") instead. Print a small test file first. The standard size of a Unix 8.5x11 inch printed page is 6-lines per inch and 10 characters per inch, which means 85 columns by 66 lines. Unix manual pages and other text outputs are often formatted to fit this size. To print these text pages correctly under Windows, select a Courier (fixed-width) font and adjust the font size smaller so that at least 80-columns fit across your printed page. Print a small test file first. Warning: Most Unix output looks best when printed using a fixed-width font such as Courier. Do *NOT* use a proportional font such as Times or Helvetica! Use Courier (or Courier New) only. Warning: Marks are deducted for printed output that contains wrapped lines. (Wrapped lines are lines that are so long that they "wrap" back to the left side of the paper. Notepad is very bad for this; Windows Write/Wordpad will also wrap unless you make the font smaller.) ------------------------------------------- Printing from Knoppix in Algonquin Lab T111 ------------------------------------------- In Algonquin Lab T111 there is a printer connected to the local network. You can configure CDROM Knoppix to have a printer queue that sends print jobs to this printer; however, be aware that any configuration you do will be completely lost when you shut down or reboot Knoppix (and you will have to redo the entire configuration next time you start Knoppix). This print queue will correctly handle Unix/Linux text files with standard Unix/Linux line end characters. To configure the print queue on Knoppix: 1. Startup a Konsole terminal from the Knoppix GUI interface. 2. In Konsole, become the root super-user using the "su" command: knoppix@ttyp0[knoppix]$ su root@ttyp0[knoppix]# Note how the prompt ends in a "#" instead of a "$" for the root user. Make sure you are the root user by verifying with the "whoami" command: root@ttyp0[knoppix]# whoami root 3. Start the CUPS printer daemon if it is missing (must be done as root): Find out if the printer daemon cupsd is already running: root@ttyp0[knoppix]# ps cax | grep cupsd If you see a line of output, skip to the next step. If you see no output, do this to start the daemon: root@ttyp0[knoppix]# /etc/init.d/cupsys start Starting CUPSys: cupsd 4. Exit the root user. (Do not work as "root" on a Unix system!) root@ttyp0[knoppix]# exit knoppix@ttyp0[knoppix]$ Note how the prompt reverts to its usual form, ending in "$". 5. In the Knoppix GUI use the mouse to go to the leftmost "K" icon ("Start Applications") in the bar at the bottom of the screen. Click on the "K" and slide up to "Settings", across and down to "Printing manager". Select it. 6. In the Printing Manager (KDE Control Module) window, make sure the selection box at the bottom of the screen says: Print system currently used: CUPS (Common UNIX Print System). 7. In the Printing Manager window, select the top left icon: Add Printer/Class 8. In the Introduction/Welcome window, select Next. 9. In the Backend Selection window, select Remote LPD queue. 10. In the LPD Queue Information window, enter this: Host: lex1855.algonquinatc.com Queue: lp Fill in the above two fields and then click on Next. (The Host name comes from the label on the front of the printer itself; use whatever name is on the front of the printer.) 11. In the Printer Model Selection window, select a Manufacturer of Lexmark and a Model of Optra S 1855. Then click on Next. (Please make sure the printer is actually an Optra S 1855!) 12. In the Printer Test window, just click on Next. (You don't need to send a test page to the printer.) 13. In the Banner Selection window, just click on Next. (No banners needed.) 14. In the Printer Quota Settings window, just click on Next. 15. In the User Access Settings window, just click on Next. 16. In the General Information window, enter this: Name: lp Location: T111 17. In the Confirmation window, click on Finish. You should now see your printer listed as "lp" in the Printing Manager window. Select this printer queue from the Print menu when you need to print something from a web browser (e.g. Mozilla). From the Knoppix command line, you can redirect text files (text files only!) to the "lpr" command to print them on this new print queue: $ lpr < somefile.txt $ who | lpr Note that the print queue you have just set up is a Knoppix print queue; it is local to the Knoppix computer in front of you. You cannot use this print queue from other computers (such as the Course Linux Server). You must transfer files to Knoppix to be able to print them using this Knoppix print queue. ---------------------------- Printing files from ACADUNIX (or some other Unix machine) ---------------------------- Here is how to get text from a file you have written and prepared on ACADUNIX to the printer on another machine. (You must do this because ACADUNIX doesn't have a printer to which you have access.) The concept here is to transfer the file you want to print onto a Windows machine that can print, using the FTP command. First, go to some Windwos machine that can print on a printer, e.g. to one of the Windows machines at the College, or perhaps your home machine. Fetching Method 1 - FTP ----------------------- Summary (details are below): Start up FTP to connect to ACADUNIX; fetch the file to the local Windows machine; exit FTP and open the local copy of the file in Winodws WRITE or WORDPAD and print it locally using a Courier font. Details: If you have a graphical version of FTP, you can use it; otherwise, here's how to use the command-line FTP program on your Windows computer: From the Windows computer that can print, start a DOS command window: - Open the Windows START menu. - Choose RUN - Enter the word "command" in the RUN box to start a DOS text window. Change to a directory in which you would like to store a copy of the file you are going to fetch from ACADUNIX. You might want to keep a copy on your N: drive, or on a floppy disk (A:). Change to that directory (and maybe to that disk) first: C:\> A: A:\> Start FTP to acadunix and login to FTP with your usual ACADUNIX Name and Password: A:\> ftp acadunix.algonquincollege.com Connected to acadunix.algonquincollege.com User: abcd0001 Password: 230 User abcd0001 logged in. ftp> (If you are at the College, you may not need to enter the domain name.) Use the "CD" command of FTP to go to the Unix directory containing your file, and then use the "GET" command of FTP to fetch your print file from Unix to the local Windows disk, e.g. ftp> cd assignments ftp> cd one ftp> get myfile.txt ftp: 1234 bytes received in 0.234Seconds ftp> quit A:\> dir myfile.txt You've got your file. Proceed to the "Printing" step below. Fetching Method 2 - TELNET Logging ---------------------------------- Summary (details are below): Login to ACADUNIX using TELNET and turn on TELNET logging; "cat" the file to the screen; turn off logging and exit TELNET; open the local log file in Winodws WRITE or WORDPAD and print it locally using a Courier font. Details: Login to ACADUNIX via TELNET using your usual userid and password. Use the mouse to select the TELNET menu that starts logging to a file. (Remember where you put the log file!) Use the "cat" command to cat the file to the screen (and thus into the TELNET log): $ cat assignments/one/myfile.txt (Note: Do *NOT* use commands such as "more" or "less" or "pg" that paginate output one screen at a time, since they will mess up the output log. You want the output to appear in one long stream in the log, uninterrupted. Use "cat".) When "cat" is done, turn off the TELNET log. Log out from ACADUNIX and then exit from the TELNET program. You've got your output; it's listed in the log file you created. Proceed to the "Printing" step below. Printing the Text File or Log File ---------------------------------- On the Windows computer to which you fetched a copy of the file you want to print, open the file and print it: Start up a Windows text editor that can print files, e.g. Windows WRITE or WORDPAD (do not use NOTEPAD), and open the text file or log file containing your output. You can start WRITE directly from a DOS prompt if you want: A:\> write myfile.txt ...a window starts up with your text in it... Now print your file from inside the WRITE or WORDPAD command. Adjust the font size smaller so that the output fits across the paper and does not wrap or break up long lines. (Do not use Windows NOTEPAD - the lines come out too long and wrap badly, losing you marks.)