Solved

D2: Page Break in TRichEdit

Posted on 1997-05-30
7
748 Views
Last Modified: 2013-11-22
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??
0
Comment
Question by:Denis053097
  • 3
  • 2
  • 2
7 Comments
 

Author Comment

by:Denis053097
ID: 1336685
I have already tried to do TRichEdit.Add(#12);
and it doesn't work  :-(
0
 
LVL 1

Expert Comment

by:slp
ID: 1336686
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
0
 

Author Comment

by:Denis053097
ID: 1336687
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.....
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 4

Accepted Solution

by:
StevenB earned 100 total points
ID: 1336688
 Yeah, It's not so much wierd as just plain rubbish. You CANNOT put page breaks in the TRichEdit, (as you've discovered). There is a specification as to the proposed performance criteria for a genuine RTF reader. This specification states that a true reader should be able to ignore, successfully (i.e. without crashing) any RTF syntax that it cannot interpret. In the case of the TRichEdit, this includes about 90% of the available functionality. Yet again I am forced to urge people not to use the TRichEdit component for anything more than the simplest editing tasks.

  The Solution?

  This is the best alternative RTF component available (based on a 5 month search for a good alternative):

  WPTools :

  http://members.aol.com/jziersch/index.html

  I hope this helps.

  Steven.

 
0
 

Author Comment

by:Denis053097
ID: 1336689
At US$130, this is quite an expensive solution !!!!
0
 
LVL 1

Expert Comment

by:slp
ID: 1336690
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.
0
 
LVL 4

Expert Comment

by:StevenB
ID: 1336691
 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.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to convert wav to mp3 in delphi 9 174
Simple Delphi Question 9 83
JAudiorecorder record freezing the app 29 60
Dev express lookupcombo 3 13
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now