Page 1 of 1

How can I combine several RTFs into a single file

Posted: Tue Nov 30, 2021 11:52 am
by WilliamPreom
Hello Sergey,

How can I combine several RTFs into a single file - the example is only for RVFs & I cannot see any procedure like InsertRTFFromStream...

Thanks,

Fiachra

Re: How can I combine several RTFs into a single file

Posted: Tue Nov 30, 2021 12:15 pm
by Sergey Tkachenko
LoadRTF and LoadRTFFromStream methods do not clear an existing document.
So, just call LoadRTF for each file you want to merge, then call Format.

Re: How can I combine several RTFs into a single file

Posted: Wed Dec 01, 2021 11:45 am
by standay
Sergey Tkachenko wrote: Tue Nov 30, 2021 12:15 pm LoadRTF and LoadRTFFromStream methods do not clear an existing document.
So, just call LoadRTF for each file you want to merge, then call Format.
Sergey, is that the same for RVF format files as well? Or do you have to use append?

Stan

Re: How can I combine several RTFs into a single file

Posted: Wed Dec 01, 2021 12:11 pm
by Sergey Tkachenko
It's the same for DocX format, but not for RVF.
LoadRVF and LoadRVFFromStream clear document before loading.
However, for RVF, additional methods are available: InsertRVFFromStream (not in the caret position but at the specified index) and AppendRVFFromStream.
Here is the example for RVF: https://www.trichview.com/forums/viewto ... ?f=3&t=272

Re: How can I combine several RTFs into a single file

Posted: Wed Dec 01, 2021 9:57 pm
by standay
Sergey Tkachenko wrote: Wed Dec 01, 2021 12:11 pm It's the same for DocX format, but not for RVF.
LoadRVF and LoadRVFFromStream clear document before loading.
However, for RVF, additional methods are available: InsertRVFFromStream (not in the caret position but at the specified index) and AppendRVFFromStream.
Here is the example for RVF: https://www.trichview.com/forums/viewto ... ?f=3&t=272
Thanks Sergey, that's what I thought but wanted to confirm. I used both the insert and append methods for RVF in my app.

Stan

Re: How can I combine several RTFs into a single file

Posted: Thu Dec 02, 2021 8:29 am
by Sergey Tkachenko
I agree that it's not consistent, but it's too late to change it.