Page 1 of 1

Richtext

Posted: Thu Jul 20, 2006 2:34 am
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.

Re: Richtext

Posted: Thu Jul 20, 2006 7:47 am
by Enrico Maria Giordano
From the MSDN:
This message returns the zero-based index of the line.
EMG

Posted: Thu Aug 03, 2006 7:51 pm
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.

Posted: Thu Aug 03, 2006 8:14 pm
by Enrico Maria Giordano
I don't know, sorry.

EMG

Posted: Fri Aug 04, 2006 4:20 pm
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.