Printing in 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

Printing in Windows

Post by emendelson »

Ronald P. Regensburg has posted a new guide to printing from SheepShaver and Basilisk here:

http://www.emaculation.com/doku.php/she ... k_printing

I'd like to add, briefly, two further methods to his list of methods of printing from Windows:

3. Print to a networked PostScript printer

This is similar to the method described for printing to a networked printer under OS X. You will need to know the IP address of your networked PostScript printer; in the following example, I've represented that number as xxx.xxx.xxx.xxx

“Printer (LPR)” (in some versions “Internet Printer” or “TCP/IP Printer”) and click OK.

In the next “Untitled 1” dialog you will see two “Change…” buttons and in later versions also one “Create…” button. Click the second “Change…” button.

In the Internet Printer dialog enter for Printer Address: xxx.xxx.xxx.xxx. Leave the Queue field blank.

Now click the Verify button. If the printer is found at the address xxx.xxx.xxx.xxx, click OK.
(If the printer cannot be verified, you cannot proceed. Try and start again, making sure you got all steps right.)

If a “Create” button is present, click that button. If no “Create” button is present, choose Save from the File menu.

In the Save dialog the default location will be the desktop and the default name for the printer will be “xxx.xxx.xxx.xxx” (the IP address; you can choose a different name if you wish).

Click Save (“OK” in some versions). The printer will appear on the desktop.

4. Use an automated system to print to any Windows printer installed in the host.

This is also similar to a method described in the guide for OS X. It requires an automated printing system that I originally developed for use with WordPerfect for DOS on modern computers. It works with any printer that works with Windows. I've created a special version of this system for use with emulators. Start by downloading the Emulator Printing Method installer here:

https://www.dropbox.com/s/cyaju7n1s5bs7 ... d.exe?dl=1

Run the installer. It creates a folder used for temporary print files, installs the GhostScript printing software, and installs a freeware "directory monitor" program. (It also installs an uninstaller if you want to get rid of the whole system.)

By default, the folder for temporary print files is in C:\tempemu, but it can be in the root directory of any drive, and you can use any name of eight letters or less.

From the SheepShaver GUI, make sure that the drive that contains the folder for temporary print files is listed as included in "My Computer."

Launch SheepShaver, create a virtual printer as described in the guide under step 2 of the instructions for OS X. As described there, use the Desktop Printer Utility to set the default destination to Desktop-->My Computer-->C-->tempemu (or whatever drive letter and folder name you chose when installing the Emulator Printer Method).

You may now print from any application by printing with the virtual printer that you created, and saving the resulting file to My Computer-->C-->tempemu (or whatever folder you selected). After a while, the page will print from your printer.

Problems with this system: when you restart the Mac OS, it doesn't seem to be able to remember the default location for saving the print file. You'll have to select it again the first time you print. It may be possible to write an AppleScript that sets the default location every time SheepShaver starts up, using the PreFab Player as described here:

http://www.emaculation.com/forum/viewto ... f=1&t=7289

GhostScript only prints pages in the default size used by your printer. You can't use it to print odd page sizes.
Last edited by ClockWise on Wed Jul 26, 2017 8:24 pm, edited 3 times in total.
Reason:  
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Printing from SheepShaver under Windows

Post by Ronald P. Regensburg »

Thanks. We (Cat-7 and I) will evaluate the methods before adding them to the guide.

I suppose that for printing to a PostScript printer on the network for both BasiliskII and SheepShaver "BasiliskII Slirp" is used for networking. In the wiki guide for networking in Windows it is is described as unstable when used for internet access, how does it hold with printing? I also notice that in that guide addresses in TCP/IP are entered manually. Does DHCP not work with slirp in Windows as it does in OSX?

The method for automatic printing of a saved PostScript file is (at least for the user) similar as the equivalent method for OSX with your folder action script. There I need to browse to the output location for the PostScript file each time again, also without restarting MacOS.

@Cat_7: Is this method similar to your method that you rejected as being too complicated and having undesirable side effects?
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Printing from SheepShaver under Windows

Post by Cat_7 »

Didn't check yet. I guess it depends on the folder monitor tool.

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

Re: Printing from SheepShaver under Windows

Post by emendelson »

Ronald P. Regensburg wrote:I suppose that for printing to a PostScript printer on the network for both BasiliskII and SheepShaver "BasiliskII Slirp" is used for networking. In the wiki guide for networking in Windows it is is described as unstable when used for internet access, how does it hold with printing? I also notice that in that guide addresses in TCP/IP are entered manually. Does DHCP not work with slirp in Windows as it does in OSX?
DHCP seems to work with SheepShaver/OS9 under Windows. Printing does seem to be a bit unstable; my setup often crashes when trying to print.

I haven't tested networking with BasiliskII under Windows for many years. I was never able to print directly to a networked PostScript printer from Basilisk under Windows.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Printing from SheepShaver under Windows

Post by emendelson »

Ronald P. Regensburg wrote:The method for automatic printing of a saved PostScript file is (at least for the user) similar as the equivalent method for OSX with your folder action script. There I need to browse to the output location for the PostScript file each time again, also without restarting MacOS.
Since this is about OS X printing, I'll respond to it in the OS X printing thread... See you there!
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Printing from SheepShaver under Windows

Post by emendelson »

Ronald P. Regensburg wrote:The method for automatic printing of a saved PostScript file is (at least for the user) similar as the equivalent method for OSX with your folder action script. There I need to browse to the output location for the PostScript file each time again, also without restarting MacOS.
As far as I can see, OS X doesn't remember the default output folder when that folder is in "My Computer" although it can remember output folders in the "Unix" folder in OS X.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Printing from SheepShaver under Windows

Post by emendelson »

As noted above, desktop virtual printers can't remember their default location for printfiles if the location is in a "My Computer" disk in SheepShaver.

If you install the PreFab Player in SheepShaver (see below for link), then you can use this AppleScript as a Startup script to set the default location each time SheepShaver starts up. Edit the first three properties to match the setting on your specific system.

Code: Select all

-- SetPrinterLocationScript - by Edward Mendelson 7 April 2012
-- Requires PreFab Player

property printerName : "Virtual Printer"  -- replace with actual desktop printer name
property driveName : "C"  -- replace with actual drive letter
property folderName : "tempemu"  -- replace with actual folder name
property toplevelName : "My Computer"  -- don't change this one
tell application "PreFab Player™"
	disable user input from mouse & keyboard
end tell
tell application "Desktop Printer Utility" to activate
tell application "PreFab Player™"
	if exists button "Cancel" then click button "Cancel"
	set dialog folder to alias ((path to startup disk as string) & "Desktop Folder:")
	do menu menu item "Open" of menu "file"
	type printerName
	click button "Open"
	click button 3
	type "D" holding command
	type toplevelName
	click button "Open"
	type driveName
	click button "Open"
	type folderName
	click button "Choose"
	do menu menu item "Quit" of menu "File"
	click button "Save"
	yield time 30
	enable user input
end tell
tell me to quit
error number -128
For the download link and code for the PreFab Player, see here:

http://www.emaculation.com/forum/viewto ... yer#p40405

Edit: Fixed the script so that it works
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Printing from SheepShaver under Windows

Post by Cat_7 »

Hi,

It seems Print2PDF remembers the file path while the desktop printer does not.

@ emendelson: I was meaning to ask you about the tools included in your package. Directory Monitor is not free if you want to use extended features, and GSView displays the nag screen when not registered. Which versions are you including?

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

Re: Printing from SheepShaver under Windows

Post by emendelson »

Cat_7 wrote:@ emendelson: I was meaning to ask you about the tools included in your package. Directory Monitor is not free if you want to use extended features, and GSView displays the nag screen when not registered. Which versions are you including?
I think you must be thinking of a different Directory Monitor. The one I use is this one:

http://www.esnips.com/thumbnails.php?album=1169719

It's open-source freeware. There are other programs with the same name. Possibly you are thinking of one of them?

There is no GSView in my system at all. Please look in the "gs" directory - it isn't there. What I install is "Ghostscript Lite" - a reduced version of the absolutely free no-nag Ghostscript software. I can't imagine how you could have found a copy of GSView in this system. It certainly is not anything that I installed. Ghostscript is not GSView. GSView is GSView.exe, which is a graphical viewer that works with GhostScript. As you say, older versions of GSView displayed a nag screen when not registered (the current version of GSView doesn't have a nag screen, apparently). But my system does NOT use GSView, doesn't need it, doesn't install it, doesn't download it, doesn't do anything with it. In fact, this system couldn't possibly use GSView, because the Directory Monitor software runs as a process that doesn't interact with the user, and can't display anything on screen even if I wanted it to do so.

For more details on the original system that this is based on, see this page:

http://wpdos.org/automatedanyprinter.html

The program I posted uses a reduced version of the "PostScript option" described at the foot of the page.
Last edited by emendelson on Sun Apr 08, 2012 7:28 pm, edited 3 times in total.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Printing from SheepShaver under Windows

Post by Cat_7 »

Ah, thanks!
I didn't find, I assumed ;-)

Best,
Cat_7
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Printing from SheepShaver under Windows

Post by Cat_7 »

As noted above, desktop virtual printers can't remember their default location for printfiles if the location is in a "My Computer" disk in SheepShaver.
On my Windows/SheepShaver system, the path entered at the default location for print files in the lower part of the new translator desktop printer dialogue, before creating the printer, is persistent over reboots and "cold starts". Wouldn't that eliminate the need for the script?

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

Re: Printing from SheepShaver under Windows

Post by emendelson »

Cat_7 wrote:
As noted above, desktop virtual printers can't remember their default location for printfiles if the location is in a "My Computer" disk in SheepShaver.
On my Windows/SheepShaver system, the path entered at the default location for print files in the lower part of the new translator desktop printer dialogue, before creating the printer, is persistent over reboots and "cold starts". Wouldn't that eliminate the need for the script?
It most certainly would eliminate the need for a script - but that doesn't happen on my system. What OS version are you using, and what version of the Desktop Printer Utility? I am using OS 8.6 and Desktop Printer Utility version 1.2. (This is the same system I use on the Mac.) I think I had the same problem with 9.0.4, but I haven't tested it recently.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Printing from SheepShaver under Windows

Post by emendelson »

I've now tested this with 9.0.4 and Desktop Printer Utility 1.3. In the utility, I set the default destination for a "Translator" desktop printer to My Computer --> C --> tempemu and saved the desktop printer. It printed correctly to tempemu folder. When I restarted SheepShaver, it tried to print to the desktop, and I had to navigate again to the folder on My Computer.

I wonder what is working correctly in your system that isn't working correctly in mine?
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Printing from SheepShaver under Windows

Post by emendelson »

Cat_7 wrote:On my Windows/SheepShaver system, the path entered at the default location for print files in the lower part of the new translator desktop printer dialogue, before creating the printer, is persistent over reboots and "cold starts". Wouldn't that eliminate the need for the script?
I suddenly realized that you did NOT say that the default location on your system is in "My Computer." If the default location is NOT in "My Computer," then, yes, the default location is persistent over reboots. The system does not remember the default location if the default location IS in "My Computer." That is the problem I've been describing.

You can easily see why this problem occurs: If you try to create an alias on your desktop to a folder in "My Computer," that alias is broken when you restart SheepShaver. For some reason, that "My Computer" alias seems to be a kludge. The "Unix" folder in Mac SheepShaver does not have these problems.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Printing from SheepShaver under Windows

Post by emendelson »

Now this is strange - my SheepShaver setup suddenly started remembering where to print on "My Computer." I don't know why it couldn't do that before.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Printing from SheepShaver under Windows

Post by Cat_7 »

Hi,

Luckily you found that out as well, because I can't seem to find which SheepShaver/MacOS installation it was that kept its settings. I have so many...and not all do.

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

Re: Printing from SheepShaver under Windows

Post by emendelson »

I also found a workaround for the problem of the Desktop Printer not remembering its settings on "My Computer." Here it is (in outline).

Go to ResExcellence and download and install Folder Actions Plus. This extension makes it possible for Folder Action Scripts to work under OS 8/9 even when the folder is not open in the Finder:

http://www.resexcellence.com/archive_so ... dex2.shtml

Then create a folder (I create one called "WPMacAppData" in the System Folder) to use as a temporary folder for print files. Create a folder action script that copies print files from this folder to the waiting folder on your Windows machine (that waiting folder is the one set up by my emulator printing system). Here is a folder action script that should work:

Code: Select all

on adding folder items to thisFolder after receiving itemList
	
	set theExtensionList to {".ps"}
	set theSuffix to ""
	set theReversedFileName to ""
	set theOffset to 0
	
        -- test for .ps extension
	set itemText to itemList as text
	set theReversedFileName to (reverse of (characters of itemText)) as string
	set theOffset to offset of "." in theReversedFileName
	if theOffset is greater than 0 then
		set theSuffix to (reverse of (characters 1 thru (theOffset) of theReversedFileName)) as string
		if theSuffix is in theExtensionList then
                        -- we need to wait until we're certain the print file has been written to disk
                        -- this method seems to work, but I wish there were a better one
			set oldSize to 0
			set newSize to -1
			repeat while newSize is not equal to oldSize
				set oldSize to size of (info for itemList)
				delay 1.5
				set newSize to size of (info for itemList)
			end repeat
			copyFile itemList as string to "My Computer:C:tempemu:"  -- Jon's Commands osax
			delay 2.0 -- to avoid error when deleting file being copied
			deleteFile itemList as string  -- Jon's Commands osax
		else
			display dialog itemText & " should not be in the WPMacAppData folder."
                        -- change that name to the name of the folder that you created
		end if
	else
		display dialog itemText & " should not be in the WPMacAppData folder."
	end if
	
end adding folder items to
This uses the "Jon's Commands" scripting addition to copy the files, but the Finder should probably work also. Jon's Commands can be downloaded here (get the NON-OSX version):

http://www.seanet.com/~jonpugh/software/

Also, of course, the copyfiles line will need to be edited to match the drive letter and foldername on your system. When I get a chance I'll rewrite the script to use variables instead of hard-coded drive name and foldername, and post the revision.

Attach the folder action script to the folder in SheepShaver. Now, set up your Desktop Printer to print to the folder that you created (the one with the folder action script attached). The Desktop Printer should remember the setting because it's on the local disk, not in "My Computer."

I tested this very briefly with a reduced version of the script and it worked.

EDIT: Added link for Jon's Commands.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Printing in Windows

Post by emendelson »

I doubt anyone still cares (or ever cared) about this, but changes in DropBox mean that the download link for the "Emulator Printing Method" in the original post is now dead. The new link is:

https://www.dropbox.com/s/cyaju7n1s5bs7 ... d.exe?dl=1
User avatar
ClockWise
Site Admin
Posts: 4397
Joined: Mon May 20, 2002 4:37 am
Location: Uiwang

Re: Printing in Windows

Post by ClockWise »

I updated the link in the original post.
Post Reply