Hi,
I would like to know if there is a way to manipulate RTF text with the TRichView component without having to assign a owner form to the TRichView or TRichViewEdit. For example, inserting one RTF text after an other.
It is very important for me not to have a form or any call that would have something to do with a form.
If it is relevent, the purpose of this is to manipulate RTF text inside a Dll.
Thank you in advance,
Marcer
RTF manipulation without a form
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Here is some function I need to implement. The principle behind those functions is to use the TRichViewEdit to manipulate RTF but to have only String or Stream as parameters. To achieve that I use TRichViewEdit built in function like:
InsertText
InsertRTFFromStreamEd
SaveRTFToStream
LoadRTFFromStream
SaveHTMLToStream
RVGetTextRange
And those are the function I implement with the help of the TRichViewEdit:
TextToRTF -> Convert simple text to RTF
RTFToText -> Convert RTF to text
MergeRTF -> Take 2 RTF and merge them one after the other
InsertRTF -> Insert RTF text to a defined position
ReplaceRTF -> Use DeleteRTF and InsertRTF
SelectRTF -> Select RTF in between two position but can take a normal text (need to use TextToRTF) or a RTF text (need LoadRTFFromStream)
StringReplaceRTF -> Use RTFToText, DeleteRTF and InsertRTF
DeleteRTF -> Delete text from a normal or RTF text from a position to an other using LoadRTFFromStream, SaveRTFToSream and InsertText
StreamToRTF -> Self explanatory
RTFToHtml -> Self explanatory
I really hope I am clear enough for you to understand what I need.
Thank you for your time,
Marcer
InsertText
InsertRTFFromStreamEd
SaveRTFToStream
LoadRTFFromStream
SaveHTMLToStream
RVGetTextRange
And those are the function I implement with the help of the TRichViewEdit:
TextToRTF -> Convert simple text to RTF
RTFToText -> Convert RTF to text
MergeRTF -> Take 2 RTF and merge them one after the other
InsertRTF -> Insert RTF text to a defined position
ReplaceRTF -> Use DeleteRTF and InsertRTF
SelectRTF -> Select RTF in between two position but can take a normal text (need to use TextToRTF) or a RTF text (need LoadRTFFromStream)
StringReplaceRTF -> Use RTFToText, DeleteRTF and InsertRTF
DeleteRTF -> Delete text from a normal or RTF text from a position to an other using LoadRTFFromStream, SaveRTFToSream and InsertText
StreamToRTF -> Self explanatory
RTFToHtml -> Self explanatory
I really hope I am clear enough for you to understand what I need.
Thank you for your time,
Marcer
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
One of possible solutions - to create a form with TRichViewEdit but do not show it.
Another solution is trying to avoid editing operations. To insert someting into the specified position, you can use InsertRVFFromStream method. This is the only non-editing method allowing to insert data in the middle. You can convert text or RTF to RVF (using another TRVReportHelper) and then insert RVF.
(additionally, a non-editing method for inserting text in the middle can be found in mail merge demos http://www.trichview.com/forums/viewtopic.php?t=8 , specifically in mailmerge-text3.zip )
Another solution is trying to avoid editing operations. To insert someting into the specified position, you can use InsertRVFFromStream method. This is the only non-editing method allowing to insert data in the middle. You can convert text or RTF to RVF (using another TRVReportHelper) and then insert RVF.
(additionally, a non-editing method for inserting text in the middle can be found in mail merge demos http://www.trichview.com/forums/viewtopic.php?t=8 , specifically in mailmerge-text3.zip )