[futurebasic] Re: [FB] OS X printing as per Doug and Robert P.

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 2005 : Group Archive : Group : All Groups

From: Steve Crossman <steve@...>
Date: Fri, 8 Apr 2005 15:59:45 -0400
Is there a way to force the pages setup scaling size without bringing 
up the Page Setup dialog ?

I print crude 72 dpi bar codes using plots line command, and when the 
bar codes get really long, I use the printer's scaling to reduce the 
dpi and fit the bar code label within a smaller area. but the user must 
set the scale and remember to change it back.  not an elegant solution, 
but bar code labels aren't printed every day :-)

some day I hope to convert to printing lines smaller than the screens 
resolution.


tia

~ steve

On Mar 16, 2005, at 5:05 AM, Robert Purves wrote:

>
> George Beckman wrote:
>
>> Robert Purves wrote:
>>
>>> The FB runtime creates a valid PMPageFormat and assigns it to 
>>> gFBPageFormat when you execute either
>>> def lprint
>>>   or
>>> dummy = PRHandle
>>>
>>> The FB runtime disposes the PMPageFormat when you call close lprint.
>>
>> I modified my FN as seen below.   fn PMSetOrientation returns no 
>> error until after the app has printed once.   Then it always returns 
>> an error.   If I cancel the def print it continues to work.   This 
>> makes me think that when the handle is disposed of something is not 
>> right.
>
> The demo prints two pages of different orientations.
>
> '-----------
> _kPMPortrait  = 1
> _kPMLandscape = 2
>
> local fn SetPrinterOrientation( orient as PMOrientation )
> '~'1
> dim as OSStatus  err
> dim as long      dummy
> dim as PMRect    pagePMRect
> dim as Rect      pageRect
>
> dummy = PRHandle
> err = fn PMSetOrientation( gFBPageFormat, orient, _false )
> if ( err == _noErr ) then err = fn PMGetAdjustedPageRect( 
> gFBPageFormat, pagePMRect )
> // fix the PRHandle to contain the new adjusted page rect
> long if ( err == _noErr )
> pageRect.top    = pagePMRect.top
> pageRect.left   = pagePMRect.left
> pageRect.bottom = pagePMRect.bottom
> pageRect.right  = pagePMRect.right
> BlockMove @pageRect, @gFBPRHandle&..prInfo.rPage`, sizeof( Rect )
> end if
> end fn = err
>
> // main program
> def lprint
> long if ( prCancel == 0 )
> fn SetPrinterOrientation( _kPMLandscape )
> route _toPrinter
> print "Landscape"
> route _toScreen
> close lprint
> end if
>
> def lprint
> long if ( prCancel == 0 )
> fn SetPrinterOrientation( _kPMPortrait )
> route _toPrinter
> print "Portrait"
> route _toScreen
> close lprint
> end if
>
> stop "Done"
> '-----------
>
>
> Robert P.
>
> --
>