Automated printing system for Mac emulators under Windows

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

Post Reply
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Automated printing system for Mac emulators under Windows

Post by emendelson »

EDIT (2 August): Improved version uploaded; same filename.
EDIT (3 August): Very slightly improved version uploaded; same filename.

I've put together a system that makes it possible for Windows users to print from a Mac emulator to the default Windows printer. It's fairly easy to set up, and then works automatically. It should work equally well from SheepShaver and Basilisk II.

The way it works is this: when you print from a Mac emulator, you will save the PostScript output file to a directory on your Windows system. A "directory monitor" program running in Windows will detect the creation of this print file and send it to the Ghostscript Postscript-emulation program, which will print the print file to your Windows printer.

You'll need to set up the Mac part of the system by yourself. I've created a script that installs all of the Windows part automatically.

Here are the details:

In the Mac emulator, install the LaserWriter 8 driver found here:

http://docs.info.apple.com/article.html?artnum=58307

(If you use an OS older than 7.6.1, you'll need to find an older version of the driver.)

After installing the LaserWriter 8 driver, set up printing. From any application that prints, give the Print command, then from the printing dialog, select Printer: LaserWriter and change Destination: from Printer to File.

In the drop down list below Printer:, choose Save as File; set Format as PostScript Job; set PostScript Level as Level 2 and 3; set Data Format as Binary; and set Font Inclusion as All But Standard 13. Click Save Settings, then Cancel, and then shut down the emulator.

(Suggestion: If you download and install the Adobe PS driver for OS 8/9, you can set up a "Virtual Printer" that will always save to a file, but that's more complicated to set up.)

Next, in Windows, download and install the script I wrote that installs a "Directory Monitor" (folder-watching) service:

http://files.getdropbox.com/u/271144/Pr ... rinter.exe

This installer is a reduced version of a similar script that I devised for a similar printing system that can print from WordPerfect for DOS (under Windows) to any Windows printer. Briefly, the installer does this (prompting you every step of the way):

1. It sets your Windows "system default" printer (typically a printer that you never actually use, such as Microsoft XPS writer) to be the same as your actual "user default" printer.

2. If you don't have the Ghostscript Postscript-emulation software on your system, it automatically downloads and installs it.

3. It creates a folder on your Windows hard disk that will be used for storing temporary print files. The installer suggests a location for this folder, but you can change the selection; I suggest that you do NOT use any existing folder. If you have more than one partition on your Windows system, it's probably best to choose a partition that is NOT your Windows system partition, because you will need to give your Mac emulator access to this partition in order to print, and it's probably safer not let the Mac OS access your Windows system drive if possible.

4. It installs a Directory Monitor service written by a programmer who calls himself Chicks and who devised this as a system for printing PDF files automatically. (Only if you're interested: search google for "chicks dirmonitor" without quotation marks for a link to the original program and source code, but the actual program is installed by my program, so you don't need to download the original Chicks program or anything else.)

The installer includes an option to set up a "Basic" or "Enhanced" version of the system; I recommend setting up the "Enhanced" system, which will print to whatever printer is your current default printer. The "Basic" system prints to the printer that is your default printer at the time you run this installer, and you have to run the installer again if you change printers. The "Enhanced" system prints to whatever printer is your default printer at any time. You need to enter your Windows password to set up the "Enhanced" system, but the installer does NOT save or send that password.

If the installer fails at any point, just run it again. (Warning: this system will not work if your printer is part of a "domain" in a Windows network - but it WILL work if your printer is part of a home or small-office network. If you are in doubt whether your printer is part a domain, it probably is NOT, and this system will work.)

Next, run the Preferences program for your emulator, and enable the option that lets you access drives from your Windows system from the "My Computer" icon in your emulator. Specify that the emulator should access the drive letter that you selected for temporary print files when setting up the printing system. This option is in different places in various programs used to set up preferences; consult the how-to guides on this site if you need help.

Start the emulator. Click the My Computer icon to make sure that the drive you selected for temporary print files is accessible from the emulator. For example, you may have chosen Drive E: on your Windows system. Make sure that the drive and the folder that you selected (for example E:\autops) are accessible through the My Computer icon.

Now print from the emulator. Print with the destination set as File; when saving the print file, navigate to your Mac desktop, then "My Computer", then whatever drive you choose (for example Drive E:), then the folder that the installer created for temporary print files (for example E:\AUTOPS). Save the print file under whatever name the dialog box suggests, but the filename must end with the extension ".ps". After a few seconds, the file should print from your Windows printer.

Please note that this system comes with NO technical support. If you have trouble setting it up, please read these instructions again. The installer includes many screens with detailed instructions. Please read those instructions before asking any questions.

If you don't like this system, you can remove it from your Windows system easily. First, use the Windows remove-program feature to remove Ghostscript. Next, run my installer script again, and follow the prompts that explain how to remove the Directory Monitor system.

If you don't trust my installer program (and there is no reason why you should trust it or anything else you download from the internet), you can study the source code here:

http://files.getdropbox.com/u/271144/Pr ... rinter.au3

The source code is an AutoIt script file; the executable version was compiled with the tools available at www.autoitscript.com. The executable version contains the files used by the Directory Monitor program and the NTRIGHTS.EXE utility from the Windows 2003 Resource Kit; this utility is used for setting up permissions for the "Enhanced" version of the Directory Monitor setup.

EDIT: Corrected the description of NTRIGHTS.EXE above.
Last edited by emendelson on Mon Aug 03, 2009 2:23 pm, edited 3 times in total.
User avatar
ClockWise
Site Admin
Posts: 4397
Joined: Mon May 20, 2002 4:37 am
Location: Uiwang

Post by ClockWise »

This looks really great!

I'll bring my laptop to work and try it out with a printer.

Do you mind if I copy and paste the directions into the main page wiki? Everything in the wiki is Creative Commons Licensed, so someone might be able to use the data elsewhere.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Post by emendelson »

OK, let me know if it works on your system. And, yes, of course, please feel free to post the instructions on the wiki. I'm delighted that other people might want to use this system.
drmoss_ca
Space Cadet
Posts: 8
Joined: Sat Jul 18, 2009 6:56 pm

Post by drmoss_ca »

If I remember correctly, when I used SheepShaver just for fun with XP on Parallels (byzantine, I know) I could use Apple's Desktop Printer utility to create a desktop printer that would work directly. It certainly works for SheepShaver under OSX too.

Chris
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Post by emendelson »

drmoss_ca wrote:If I remember correctly, when I used SheepShaver just for fun with XP on Parallels (byzantine, I know) I could use Apple's Desktop Printer utility to create a desktop printer that would work directly. It certainly works for SheepShaver under OSX too.
It's certainly possible to print directly from SheepShaver to a networked printer using IP printing (to an IP address on the network), or, under OS X, either through IP printing or by sending print files to a folder with a Folder Action Script attached that automatically prints incoming files.

But you seem to be suggesting that you did something much simpler than that. If that's the case, then perhaps you might consider starting a new thread that spells out your methods. A lot of people on this forum would be VERY grateful to learn exactly how you did this - with complete step-by-step instructions if possible.

The point of this new system is that it prints to whatever the current Windows default printer is. It doesn't need to be an IP printer; it doesn't need to be shared; all it needs to be able to do is print from Windows like any other Windows printer.
Last edited by emendelson on Sun Aug 02, 2009 3:31 pm, edited 1 time in total.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Post by emendelson »

You might want to wait on testing this until I upload a revised version that will work with any file with a *.ps extension, not only "untitled.ps." This may take a few hours to get right.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Post by emendelson »

Revised version now posted. I've updated the first post to match the new system.
User avatar
ClockWise
Site Admin
Posts: 4397
Joined: Mon May 20, 2002 4:37 am
Location: Uiwang

Post by ClockWise »

I'm going to have to buy a parallel to USB adaptor (or something) before I can try this out.

But I will do that real soon!
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Post by emendelson »

If you can print from Windows, this system will work with your current default printer - even if the printer is connected only through a network (wired or wireless). If you can print from Windows (for example, by typing Ctrl-P and printing this page), then this method will work.

Again: the point of this system is that it prints from your emulator directly to whatever printer you use in Windows.

Two things to keep in mind. During the initial installation, sometimes Windows doesn't completely install the directory monitoring system, and the test file doesn't print. If that happens, run the installer again. If the test file doesn't print during the first installation, it usually prints the second time. You may even need to run the installer three times.

Also, I've tried to set this up so that it will work without problems. But it may need some minor adjustments so that it works with other systems. If you find that it doesn't print reliably, try these adjustments:

In your \Program Files\DirMonitor folder, you will find two .CMD files; these are plain-text batch-files. Each file contains lines that are used to delay the next step in the batch file by running the PING command to the local machine, something like this:

ping 127.0.0.1 -n 5

You can try increasing the number at the end (from 5 to 6, or 1 to 2, or whatever) and see if this fixes the problem. If it does, please let me know and I'll change the files in the installation.

By the way, this same method can of course be used to print from a Linux emulator running under Windows.
drmoss_ca
Space Cadet
Posts: 8
Joined: Sat Jul 18, 2009 6:56 pm

Post by drmoss_ca »

emendelson wrote:
drmoss_ca wrote:If I remember correctly, when I used SheepShaver just for fun with XP on Parallels (byzantine, I know) I could use Apple's Desktop Printer utility to create a desktop printer that would work directly. It certainly works for SheepShaver under OSX too.
It's certainly possible to print directly from SheepShaver to a networked printer using IP printing (to an IP address on the network), or, under OS X, either through IP printing or by sending print files to a folder with a Folder Action Script attached that automatically prints incoming files.

But you seem to be suggesting that you did something much simpler than that. If that's the case, then perhaps you might consider starting a new thread that spells out your methods. A lot of people on this forum would be VERY grateful to learn exactly how you did this - with complete step-by-step instructions if possible.
I did it exactly as I do with Sheepshaver in OSX. I used Apple's Desktop Printer Utility to create a desktop printer, the only thing you need to know is the IP address of your networked printer (must be a fixed IP, not dynamically allocated by DHCP on the router). Here's a screen shot of a legacy programme based on the old Omnis database (don't laugh: it's how I get paid!) running in Sheepshaver, in WinXP running in Parallels on OSX. When my last G5 dies I'll be using Sheepshaver in OSX to get paid - I just did it in Parallels for fun.

Image

Note the desktop printer identified by the IP address 10.0.1.55? I don't see why it shouldn't work on a computer running XP as opposed to XP running in Parallels, but I confess I haven't tried it!

Chris
Last edited by drmoss_ca on Tue Aug 04, 2009 11:43 pm, edited 1 time in total.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Post by emendelson »

IP printing should work anywhere. The point of the system I posted is that your printer can be connected via a USB cable - and not be a network printer at all. Not everyone uses a printer with an IP address.
drmoss_ca
Space Cadet
Posts: 8
Joined: Sat Jul 18, 2009 6:56 pm

Post by drmoss_ca »

I'm sorry, I hadn't seen that part about a directly connected printer.

Chris
mschmitt
Tinkerer
Posts: 80
Joined: Sun Jul 05, 2009 10:33 pm

Post by mschmitt »

emendelson wrote:IP printing should work anywhere. The point of the system I posted is that your printer can be connected via a USB cable - and not be a network printer at all. Not everyone uses a printer with an IP address.
Why not just have the host share the attached printer, then print to it from the SheepShaver Mac using LPR?

Apple even gave instructions for how to do it with OS X sharing the printer.

Windows can do LPR printer sharing also. You just have to turn on Print Services for Unix.

Note: While I have used this method to share an OS X printer with OS 9, I haven't tried it with SheepShaver.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Post by emendelson »

Any of those methods work perfectly well - if your printer is a PostScript printer.

I don't suggest that anyone should use this method in preference to IP or LPR printing. The whole point of it is that, after the system is installed, it automatically prints to the default Windows printer without any further setup, even if the printer is a cheap printer that has no support for Postscript. I use this method for virtual Linux machines, DOSBox, Mac emulators, etc., and it works even with GDI printers that have no PostScript support at all.
User avatar
ClockWise
Site Admin
Posts: 4397
Joined: Mon May 20, 2002 4:37 am
Location: Uiwang

Post by ClockWise »

So I have no way of getting my laptop connected to a printer.

After I get back from vacation, I will hunt around for the proper adapter and then try this out.

:(
User avatar
ClockWise
Site Admin
Posts: 4397
Joined: Mon May 20, 2002 4:37 am
Location: Uiwang

Post by ClockWise »

Finally found the right cable at a nice basement computer shop. Will try this out tomorrow!!
Galane
Tinkerer
Posts: 58
Joined: Mon Sep 07, 2009 3:03 am

Post by Galane »

This works because GhostScript is a PostScript interpreter for printers that have no built in PostScript ROM.

If you have a printer with PostScript built in (or added via a ROM module) *and* there are old Mac drivers for it, then there are other ways to print to it.

I've used a LaserJet 4M with a JetDirect ethernet printserver in it's MIO slot. Direct IP printing from the Mac emulator.

PowerPrint for networks may also work, but you either need the printserver that was sold with it, or possibly another printserver might work if it can be renamed. 'Course you'd need to know the name of the server which came with the PowerPrint software.

PowerPrint is a software RIP, Raster Image Processor. It takes the vector PostScript output and converts it to a large bitmap then sends that to the printer in its native language. On any 68K or older PPC Mac it's very very slow and hogs the CPU.

I used it to print from a IIci with a 66Mhz Turbo 601 to a LaserJet IIId, the one LaserJet model from II through 6 that HP had zero Macintosh support for.
Post Reply