Board index » delphi » RichEdit page count

RichEdit page count

Hi,

Anyone got any good ideas about getting a page count for a document in
RichEdit? The document has only 1 font (courier) and all at 12pt, but many
paragraphs have different 'space before' and 'space after' RTF settings. In
fact I'm using the RichEdit98 component, not that that should matter.

My idea is to take a print preview component and do a page count after
rendering, as this should be the closest way to count the pages based on the
current printer / margins etc. But I'm new to this sort of thing, and
perhaps someone has done this before?......

Thanks!

Martin Coster

 

Re:RichEdit page count


Martin R. Coster <m...@pacific.net.sg> schrieb im Beitrag
<832qrd$np...@newton3.pacific.net.sg>...

Quote
> Hi,

> Anyone got any good ideas about getting a page count for a document in
> RichEdit? The document has only 1 font (courier) and all at 12pt, but
many
> paragraphs have different 'space before' and 'space after' RTF settings.
In
> fact I'm using the RichEdit98 component, not that that should matter.

Check out the Print method of RichEdit98. To calculate the printout only,
all you have to do is to change the EM_FORMATRANGE message

SendMessage(Self.Handle, EM_FORMATRANGE, 1, [...]

to

SendMessage(Self.Handle, EM_FORMATRANGE, 0, [...]

The zero value indicates that the text is just calculated but NOT rendered.

--
Alexander Halser
+++++++++++++++++++++++++++++++++++++++
http://www.ec-software.com
Help & Manual - the next generation in help authoring

Other Threads