Printing RTFs with rePrintBox

Post Reply
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Printing RTFs with rePrintBox

Post by reinaldocrespo »

Antonio;

Hi. I'm a little lost here.

I have rtf text stored on memo fields I wish to print without displaying on the screen. With RePrintBox() it seems like I must have the rtf being displayed. right?

I tried defining the control without displaying by never calling the activate diaglog clause. But still, nothing prints. Here is what I'm using to print:

Code: Select all

local a 		:= ::oprn:Inch2Pix( 4.69, 0.75 )
local b		:= ::oprn:Inch2Pix( 9.00, 7.75 )

	::oTranscript:oTrGrss:Selectall()
	REPrintBox( ::oTranscript:oTrGrss:hWnd, If( ::isPreview, ::oPrn:hDCOut, ::oPrn:hDC ), ;
                     ::oTranscript:oTrGrss:IsSelection(), a[1 ], a[2], b[1], b[2] )


How can I print rtf, straight from the memo field to the printer or preview without redefining the richedit control?

Reinaldo.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Reinaldo,

You may keep the richedit control hidden (oRichEdit:Hide())
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Post by reinaldocrespo »

Antonio;

Yes, that did it. Thank you.

I added a new method to the same class that does the data gathering. Here is that method:

Code: Select all

*------------------------------------------------------------------------------------
METHOD DisplayHidden() CLASS PathTrans
local oSelf	:= self, i

	for i:=1 to len( ::aRtfs )
		::aRtfs[ i ]:hide()
	next i

	ACTIVATE DIALOG oSelf:oDlg CENTERED NOWAIT
	::oDlg:Hide()

return nil

*------------------------------------------------------------------------------------
Best,


Reinaldo.
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Post by reinaldocrespo »

Antonio;

More questions on RePrintBox:

I'm now able to print rtf on a given location on the tprinter page. Good. However, what happens when the text does not fit completetly and I must run to the next page?

How do I know how far did the printed text go so that I may continue on the next page with the rest of the text?

And, is there a way to know exactly at what position on the page the last line was printed?

Thank you,


Reinaldo.
Post Reply