[futurebasic] Re: [FB] Help with Printing Concept

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : July 2011 : Group Archive : Group : All Groups

From: Brian S <fblistserve@...>
Date: Fri, 1 Jul 2011 16:24:40 -0700
On Jun 30, 2011, at 11:07 PM, Sofia wrote:

> with a simple procedural example. Perhaps just to get a line or two (or even a bitmap) printed on paper.

Something simple( and not complete ) with standard FB statements( with the caveat mentioned in my first post in this thread ). There is no print loop in the code but I’ve added comments to give you an idea where they might be put. The QDSwapTextFlags is not required but you can try this with and without those statements to see the difference. Since you’re "...VERY new to API programming" maybe let us know a little background so the answers aren’t too advanced or too simple. 

_kQDUseCGTextRendering = (1 << 1)
toolbox fn QDSwapTextFlags( UInt32 ) = UInt32

fn QDSwapTextFlags( _kQDUseCGTextRendering )// fix QD lack of anti-aliasing for PRINT statement

def lprint// ask user 
long if ( prCancel == _false )// did they cancel print?

// start a print loop here that prints one line per loop iteration
// e.g. pseudo-code loop for illustration only
// while ( linesToPrint > 0 )   // start loop
route _toPrinter
text _sysFont, 12, 0 , _srcOr
print "Something"

text _sysFont, 12, _ulineBit% + _boldBit%, _srcOr
print "Something underlined and bolded"

// need logic here to decide when a page is full and do page break.
route _toScreen
clear lprint  //top of new page 
//wend      // end loop

// this should be outside the print loop and execute when all the pages are printed
route _toScreen
close lprint// end of print job

end if


Brian S