Link to home
Start Free TrialLog in
Avatar of Denis053097
Denis053097

asked on

D2: Page Break in TRichEdit

How can I insert a "page break" (ie, tell the printer I want to jump to the top of a new page now) in a TRichEdit form??
Avatar of Denis053097
Denis053097

ASKER

I have already tried to do TRichEdit.Add(#12);
and it doesn't work  :-(
Just an observation: I have yet to figure out how to do a hard page break in WordPad (in case you're wondering, it's NOT Ctrl+Enter, as you might expect from Win3.1's Write or MS-Word experience).  I do believe that WordPad is based on the RichEdit common control; so I'm wondering if MS somehow managed to miss including this rather useful bit of functionality in the implementation of RichEdit.  One alternative (as always) is to make blank lines until the page breaks automatically (aiieee, shades of newbie word processor users!)

I'll keep looking and let you know.

SLP
It actually gets a lot worse than this... I have created a short document in MS Word with a manual page break into it and saved it as a RTF file.  The manual page break shows off as \page.

When I load this document in a TRichEdit via the LoadFromFile procedure, the page break is destroyed (which I could verify by resaving the content of the TRichEdit via the SaveToFile procedure into a different file -- there is no \page command).

Weird.....
ASKER CERTIFIED SOLUTION
Avatar of StevenB
StevenB

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
At US$130, this is quite an expensive solution !!!!
The RTF spec says a reader should be able to IGNORE uninterpretable RTF?  Last time I looked, IGNORE <> DELETE, sounds like big time BUG to me.

I looked at WPTools myself a few months back when it was definitely not ready for prime time, you think it's improved since then?  I recently had a look at UDC Memowriter and was simultaneously impressed and dismayed.  So, I'm still using the TX control with the Delphi RAD Pack for what little RTF stuff I have to do right now.
 Denis: I suppose it is expensive, it depends how you're working. If you're part of a company writing professional software, then its not too much of an expense. If you're just working alone for entertainment, then yes, it is pricey. There are cheeper alternatives though, however WPTools really was the best I found, for a reasonable price.

  slp: Point taken. A true reader should be able to save the RFT to file without changing it in any way, even if it cannot interpret it. In what way do you think that WPTools was lacking? I was impressed with its overall performance (compared to other components). The transparent editing is now available. The only problem is the non WYSIWYG scaling of fonts during zooming. Julian, the author, claims to be sorting this out soon. I suppose ultimately your choice of text editor depends very much on your projects requirements are. I, for example, have the specific imperative that the editor text be available as a metafile. Others may have requirements that are better solved withe other components.

  Steven.