[futurebasic] Re: [FB] OS X printing

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 2002 : Group Archive : Group : All Groups

From: Douglas Stemen <dstemen@...>
Date: Mon, 23 Dec 2002 19:23:04 -0500
Robert,

This is really weird. PMSetOrientation only works once, for the first 
print job, while the program is running. After the first print job 
PMSetOrientation no longer sets printing to landscape mode. If I stop 
the FB program and then start it again then the first print job again 
prints correctly. Using FN GetAdjustedPageRect or WINDOW(_width) only 
gets the proper dimensions for the first print job.

I checked in my program and the constant _kPMLandscape retains its 
value of 2 thus this not reset by FB.

Thus, calling PMSetOrientation each print job does not fix the problem.

Any other thoughts?

Thank for your help.

Doug

> On Monday, December 23, 2002, at 06:26 PM, Robert Purves wrote:
>
>
>> On Tuesday, December 24, 2002, at 02:10  AM, Douglas Stemen wrote:
>>
>> I appreciate your help with this.
>>
>> This routine does allow PRHANDLE to get the correct page boundries 
>> that correspond with landscape printing. However, in my program when 
>> FN GetAdjustedPageRect is called the print orientation is incorrectly 
>> switched back to portrait when printing to a printer (even though the 
>> width is correct for landscape)
>
>
> I think that FN GetAdjustedPageRect is innocent.  Something about the 
> act of printing resets the default print orientation, as shown in the 
> demo below. (The first page is printed landscape, as desired, but the 
> second is in portrait orientation).  The culprit may be  close lprint.
>
> You will have to call PMSetOrientation each time you print, to set 
> _kPMLandscape.
>
>
> '---------------
> '~'A
> '                           CPU : Carbon
> '~'B
> _kPMPortrait  = 1
> _kPMLandscape = 2
> toolbox fn PMSetOrientation( PMPageFormat pageFormat, ¬
>                 UInt16 orientation, Boolean lock ) = OSStatus
>
>
> dim as Handle    myPRHandle
> dim as OSStatus  err
>
> myPRHandle = prHandle
>
> // set landscape orientation
> err   = fn PMSetOrientation( gFBPageFormat, _kPMLandscape, _false )
> if err then stop "PMSetOrientation error " + str$( err )
>
> def lprint
> long if prCancel == _false
> route _toPrinter
> print "Landscape :-) "
> route _toScreen
> close lprint
> end if
>
> def lprint
> long if prCancel == _false
> route _toPrinter
> print "Reverts to Portrait :-( "
> route _toScreen
> close lprint
> end if
>
> do
> HandleEvents
> until 0
> '---------------
>
>
> Robert P.
>
>
> --
> To unsubscribe, send ANY message to 
> <futurebasic-unsubscribe@...>
>