[comp.sys.mac.programmer] Printing on Index Cards?

oster@dewey.soe.berkeley.edu (David Phillip Oster) (11/30/89)

In article <222@cvbnet.Prime.COM> aperez@cvbnet.UUCP (Arturo Perez x6739) writes:
_>Second attempt at getting an answer to this:
_>
_>I have a stack that I would like to print onto 3x5 (or, if that's
_>impossible, 5x8) index cards using an ImageWriter II.
_>
_>The problems I've run into are:
_>
_>	1) The background of cards in HyperCard cannot be changed
_>		in size to be smaller that 5x8.  If you make a card
_>		that's smaller than the background then when it's
_>		printed, all the blank space around the card is "printed"
_>		as well, leading to a horrible waste of paper.
_>
_>	Is there anyway to make the background smaller, or at least not
_>	print?
_>
_>	2) In "Page Setup" within HyperCard, the 50% reduction item
_>		is eliminated.
_>
_>	So now I can't print a single card from the stack in anything but
_>	full size.  Anyway around this?
_>
_>	3) The ImageWriter II doesn't seem to understand the size of
_>		index cards.  I would like to be able to configure the
_>		printer to print onto the index cards, i.e. tell it that
_>		it is printing onto 3x5 (or 5x8) paper which can be either
_>		pin-feed or tractor feed.
_>
_>	Is there any way to configure the ImageWriter to print onto things
_>	other than 8x11 paper?  Is there a software solution?  Do I have to
_>	write an ImageWriter driver to do this?
_>
_>
_>I also have lots of insoluble problems (e.g. the carriage isn't wide enough
_>to print on paper larger than ~10x??) that I can accept.
_>
_>Any and all solutions welcome.  I'm a hardcore C programmer (Unix & VMS 
_>background) so if I have to write a driver then I have to write a driver...
_>
_> 
_>Arturo Perez						aperez@cvbnet.prime.com
_>ComputerVision, a Prime Business Unit			(617) 275-1800 x6739
_>"Too much information, like a bullet through my brain!" - The Police


I've taken the libery of quoting much of your original response since I am
widening the crosspost to include comp.sys.mac.programmer, which
will also be interested.

My program, Address Book Plus, does this. First, I check the printer type,
from a validated print record, to see if it is mutable.  Rather than hard
coding a list of mutable printers, I look in a resource of type='Pmut',
id=128, which is a list of 16-bit integers of mutable printers.

If the printer is mutable, then it has a resource of type 'PREC' id = 3,
with the following structure:
#define NumPageOptions	6
typedef struct{
	Integer	numItems;					/* Number
of size options displayed */
	Point   botRights[NumPageOptions];	/* Bottom right for size
option.	*/
	char	titles[];					/* Name
for size option.			*/
}PageSizeRecord, *PageSizePtr, **PageSizeHdl;

Where the units of the botRights array is 1/120 of an inch, and the
titles are packed Pascal strings (no pad bytes.) The sixth item is
unused in the standard driver.  You clone the PREC,3, and do an
AddResource to a file in the resource search path with PREC,4. (Do NOT
permanently modify the printer driver, or it will crash!) Add the new page
size, and page size string, and instruct the user to pick the custom size.
This will get the imagewriter to feed your tractor feed index cards.

If you are doing this to print names and addresses, you might consider my
program, "Address Book Plus". 

There is a different, but similar way of doing this on the laserwriter,
but you must be using LaserWriter driver version 6, and Apple has said
they will not support that way in the future, so I won't go into detail.

> The mac is a detour in the inevitable march of mediocre computers.
> drs@bnlux0.bnl.gov (David R. Stampf)
--- David Phillip Oster          -master of the ad hoc odd hack. 
Arpa: oster@dewey.soe.berkeley.edu 
Uucp: {uwvax,decvax}!ucbvax!oster%dewey.soe.berkeley.edu