Richtext

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

Richtext

Post by reinaldocrespo »

Antonio /Everyone;

Hi.

Does the method GetLineFromChar( nChar ) on the richtext class returns the position of the given nchar in centemeters or inches or what?

It does not seem to be working properly. Does anybody know?


Best,


Reinaldo.
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Richtext

Post by Enrico Maria Giordano »

From the MSDN:
This message returns the zero-based index of the line.
EMG
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Post by reinaldocrespo »

Enrico;

Then what I need is to find out where on the page did that last line printed vertically. This is so that I can go on printing other stuff on the next line after that.

So if I print with:

Code: Select all

	nFrom := REPrintBox( oRtf:hWnd, ::oPrn:hDCOut, .t., nTop, nLeft, nBottom, nRight, nFrom )
Then with:

Code: Select all

	oRtf:GetLineFromChar( nFrom )

I know the last line from the richtext that printed. But how can I find out where in inches or centemeters on the page did it print?

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

Post by reinaldocrespo »

Enrico;

I sort of have a solution:

Code: Select all

::nLastLine := ( ( aoRtf[i]:GetLineFromChar( nFrom ) - nTmp ) * ::oprn:Pix2Inch( aortf[i]:oFont:nHEIGHT, 0 )[1] ) + nTOPOffset

::nlastline += 0.32		//couple of blank lines
Where nTmp is the line index into the richtext that printed at the first line of the page.

It seems to be working...

RC.
Post Reply