[comp.sys.mac.programmer] Changing Imagewrite defaults

freda@tekig5.PEN.TEK.COM (Fred Azinger) (10/19/89)

I need help with changing the default "style" for printing on a imagewriter.

My application does alot of circle drawing which I would naturally like to remain
circles when printed...the laserwriter does this just fine, however I ALWAYS need
to set TALL ADJUSTED in the sytle dialog in order for circles to come out correct
on an Imagewriter!  Since my application depends on circles being circles I want
TALL ADJUSTED to be the default style when using an imagewriter.  I know how to
sense if an imagewriter is the printer of choice, but cannot find the right location
to poke to set TALL ADJUSTED.  Inside Mac is extreamly vague on how to print and says
squat on TALL ADJUSTED.  Anyone been here before???

Thanks in advance,
Fred Azinger
Tektronix Inc.

PS: below is the (trimmed) code I am running:


procedure Print;
begin
   PrOpen;
    
   hPrint := THPrint(NewHandle(SizeOf(TPrint)));
    
   PrintDefault(hPrint);

       {****************************************************************}
       {**** CHANGE IMAGEWRITER DEFAULT STYLE TO TALL ADJUSTED HERE ****}
       {****************************************************************}
       
   PRBool := PrStlDialog(hPrint);
   PRBool := PrJobDialog(hPrint);

   myPrPort := PrOpenDoc(hPrint,NIL,NIL);      {open printing grafPort}
        
   if PrError = noErr then 
   begin
       PrOpenPage(myPrPort,NIL);               {start new page}
	
	{**** QUICKDRAW STUFF HERE ****}
            
       PrClosePage(myPrPort);
   end;
        
   PrCloseDoc(myPrPort);
   PrPicFile(hPrint,NIL,NIL,NIL,prStatus);
end;
    

earleh@eleazar.dartmouth.edu (Earle R. Horton) (10/19/89)

In article <4933@tekig5.PEN.TEK.COM> freda@tekig5.PEN.TEK.COM
	(Fred Azinger) writes:
>I need help with changing the default "style" for printing on a
>imagewriter.
>
>My application does alot of circle drawing which I would naturally
>like to remain circles when printed...the laserwriter does this just
>fine, however I ALWAYS need to set TALL ADJUSTED in the sytle dialog
>in order for circles to come out correct on an Imagewriter!  Since my
>application depends on circles being circles I want TALL ADJUSTED to
>be the default style when using an imagewriter.  I know how to sense
>if an imagewriter is the printer of choice, but cannot find the right
>location to poke to set TALL ADJUSTED.  Inside Mac is extreamly vague
>on how to print and says squat on TALL ADJUSTED.  Anyone been here
>before???

It is unwise to try to poke fields in the print record.  A safer
technique is to print something using the style you want, and then
save the print record you used as the default.  Then, when you create
a new print record, skip the PrintDefault, fill in the whole print
record with your saved copy, then pass it to PrValidate.  If
PrValidate returns FALSE, then everything should be just fine.

I am sceptical about your claim of being able to detect when an
ImageWriter is installed.  There are a lot of third party drivers out
there, and it is just possible that one of them would look like an
ImageWriter to your application.  If you use the technique I suggest,
and PrValidate returns TRUE, then it might be an indication that the
printer is not an ImageWriter after all, and you might want to go for
a PrintDefault setup.

The Print Manager should allow users to determine what the default
printing style should be.  I sure hope they put this in the System 7.0
print architecture.

Earle R. Horton

pwp@shamash.cdc.com ( HOUFAC) (10/19/89)

In article <4933@tekig5.PEN.TEK.COM> freda@tekig5.PEN.TEK.COM (Fred Azinger) writes:
>I need help with changing the default "style" for printing on a imagewriter.
>
> <...> I want TALL ADJUSTED to be the default style when using an imagewriter.
> <The rest deleted>

Just a thought -- can this be accomplished by using PrGeneral to set the
resolution?  You should be able to fetch the available resolutions, then
set whichever one corresponds to having tall-adjusted on (144x144?, 72x72??)
if it is available.  With a little care, it might even be possible to do this
in such a way that you don't have to special-case the Imagewriter.

--Pete Poorman  pwp@shamash.cdc.com

casseres@apple.com (David Casseres) (10/25/89)

In article <14296@shamash.cdc.com> pwp@shamash.cdc.com ( HOUFAC) writes:
> In article <4933@tekig5.PEN.TEK.COM> freda@tekig5.PEN.TEK.COM (Fred 
Azinger) writes:
> >I need help with changing the default "style" for printing on a 
imagewriter.
> >
> > <...> I want TALL ADJUSTED to be the default style when using an 
imagewriter.
> > <The rest deleted>
> 
> Just a thought -- can this be accomplished by using PrGeneral to set the
> resolution?  You should be able to fetch the available resolutions, then
> set whichever one corresponds to having tall-adjusted on (144x144?, 
72x72??)
> if it is available.  With a little care, it might even be possible to do 
this
> in such a way that you don't have to special-case the Imagewriter.

Yup, that's the right way to do it.  You don't have to know it's an 
ImageWriter at all, just examine the available combinations of horizontal 
and vertical resolution and pick one where they're equal.  Your code will 
then work on all printer drivers that support PrGeneral, which includes 
all current Apple printer drivers.

David Casseres

Exclaimer:  Hey!