[comp.sys.mac.programmer] Changing Page Setup Defaults: How do I do it?

philf@lindy.Stanford.EDU (Phil Fernandez) (08/03/89)

My application currently uses standard Print Manager Page Setup... and
Print... dialogs for printing to a LaserWriter (ImageWriter not really
useful in this application).

Trouble is, I want the Page Setup defaults to select "landscape"
orientation rather than portrait, and to select "Larger Print Area"
from the LaserWriter options.  Although the user may occasionally want
to deviate from these defaults, they will be correct 95% of the time.

Is there any way for me to "initialize" the dialog so that these
defaults are selected?  A reading of IM and the TNs hasn't yielded my
answer; or at least I've overlooked it if its there.

Thanks...phil

+-----------------------------+----------------------------------------------+
| Phil Fernandez              |             philf@metaphor.com               |
|                             |         ...!decwrl!metaphor!philf            |
| Metaphor Computer Systems   |"Does the mind rule the body, or does the body|
| Mountain View, CA           | rule the mind?  I dunno..." - Morrissey      |
+-----------------------------+----------------------------------------------+

isle@eleazar.dartmouth.edu (Ken Hancock) (08/03/89)

In article <4157@lindy.Stanford.EDU> philf@metaphor.com (Phil Fernandez) writes:
>My application currently uses standard Print Manager Page Setup... and
>Trouble is, I want the Page Setup defaults to select "landscape"
>orientation rather than portrait, and to select "Larger Print Area"
>from the LaserWriter options.  Although the user may occasionally want
>to deviate from these defaults, they will be correct 95% of the time.
>
>Is there any way for me to "initialize" the dialog so that these
>defaults are selected?  A reading of IM and the TNs hasn't yielded my
>answer; or at least I've overlooked it if its there.

Nope, you can't.  There's no way.  You're one of many to find yet more
wonderful shortcomings to the Print Manager.  Guess we'll all have to
wait for System 7.0....


Ken







Ken Hancock  '90                    | E-mail: (BITNET/UUCP/INTERNET)
Computer Resource Center Consultant |   isle@eleazar.dartmouth.edu
------------------------------------+---------------------------------------
DISCLAIMER?  I don't get paid enough to worry about disclaimers.

zben@umd5.umd.edu (Ben Cranston) (08/04/89)

In article <4157@lindy.Stanford.EDU> philf@metaphor.com (Phil Fernandez) writes:
> ...I want the Page Setup defaults to select "landscape" orientation rather
>  than portrait, and to select "Larger Print Area"

At the risk of making an utter fool of myself (since I have never actually
tried to do this), here is a possible approach.

Cache a print record globally for your application (rather than or in addition
to the print record cached with each document).  You could ship your app with
an appropriate print record for the current level of Apple printing, or
whatever system you ship with the application.

As long as printing levels do not change you should be able to propagate
landscape and/or larger print area in this fashion.  You should detect the
case that printing level changes and the print drivers are giving you a
default printing record.  In this case, put up a dialog to the user:

            Printing level has changed.
            Be sure to do a Page Setup and set the Landscape and
            Larger Print Area options.

                     [OK]

then when he does so, cache the print record.

-- 
Sig     DS.L    ('ZBen')       ; Ben Cranston <zben@umd2.UMD.EDU>
* Computer Science Center Network Infrastructures Group
* University of Maryland at College Park

casseres@apple.com (David Casseres) (08/04/89)

In article <5156@umd5.umd.edu> zben@umd5.umd.edu (Ben Cranston) writes:
> In article <4157@lindy.Stanford.EDU> philf@metaphor.com (Phil Fernandez) 
writes:
> > ...I want the Page Setup defaults to select "landscape" orientation
> > rather than portrait, and to select "Larger Print Area"

> At the risk of making an utter fool of myself (since I have never
> actually tried to do this), here is a possible approach.

Actually the suggested approach, as follows, is very reasonable.

> Cache a print record globally for your application (rather than or in
> addition to the print record cached with each document).  You could
> ship your app with an appropriate print record for the current level
> of Apple printing, or whatever system you ship with the application.

By "level" I assume you mean version.

> As long as printing levels do not change you should be able to propagate
> landscape and/or larger print area in this fashion.  You should detect
> the case that printing level changes and the print drivers are giving
> you a default printing record.  In this case, put up a dialog to the
> user:

>             Printing level has changed.
>             Be sure to do a Page Setup and set the Landscape and
>             Larger Print Area options.

> then when he does so, cache the print record.

Actually it is very unlikely that a version change will invalidate an 
existing print record for a given printer type; after all, this would 
force all existing documents to be reformatted and presumably Apple will 
try hard to avoid ever doing this.  The problem will be when your code 
encounters a different printer type.  You should cache a record for each 
type of printer you know about, and if the first one you try is invalid, 
try another, and so forth until one succeeds.  If none of your cached 
records is valid, do as Mr. Cranston says above.  Note that when the new 
printing architecture comes out, there will soon be lots of printer types 
in the game, not just the current 4 types.

David Casseres

Exclaimer:  Hey!

dowdy@apple.com (Tom Dowdy) (08/04/89)

In article <3332@internal.Apple.COM> casseres@apple.com (David Casseres) 
writes:
> [ comments about saving print records into your application ]
> try another, and so forth until one succeeds.  If none of your cached 
> records is valid, do as Mr. Cranston says above.  Note that when the new 
> printing architecture comes out, there will soon be lots of printer 
types 
> in the game, not just the current 4 types.

Dave has suggested just about the best way to handle saving of print
records into your application, but, if I can disagree for a moment:

Another approach that people might consider that I feel would be superior 
to saving the print record away in your application (Which causes trouble 
on read only volumes), would be to implement stationary pads.

The entire story is discussed in the Apple Human Interface Guidelines, but 
the basic idea is to have a kind of document that stores only the setup 
information for a particular document, and not the actual contents.  When 
the document is opened, an untitled document is created and the stationary 
settings copied into it.  The end result of this is that the user can 
configure all kinds of different "defaults" for whatever she feels works 
best at a given moment.

In this way, you leave it up to the user to decide what kind of default 
make sense in a given setting.   Plus you have added a useful feature to 
your application.  Compatibility in this scheme is surely higher than 
having print records sitting around in your application.

Keep in mind as well that while currently LaserWriters are the only thing 
you feel that it "makes sense" to want to print to, many other printers 
really do make sense.  Nothing speaks to this louder than the HP 
DeskWriter, which seems to have come roaring onto the scene with many Mac 
users purchasing them.  Your application won't look good if it treats 
these printers as second class citizens.

 Tom Dowdy                 Internet:  dowdy@apple.COM
 Apple Computer MS:27AJ    UUCP:      {sun,voder,amdahl,decwrl}!apple!dowdy
 20525 Mariani Ave         AppleLink: DOWDY1
 Cupertino, CA 95014       
 "The 'Ooh-Ah' Bird is so called because it lays square eggs."