AppendRVFFromStream showing errors

General TRichView support forum. Please post your questions here
Post Reply
martindholmes
Posts: 131
Joined: Mon Aug 29, 2005 12:03 pm

AppendRVFFromStream showing errors

Post by martindholmes »

I'm attempting to do this:

I have a set of small RVF documents saved in TMemoryStreams. Each of these documents is complete, and works perfectly when I stream it into a TRichViewEdit.

I need to combine these documents together in order to save them out as a single XHTML document. To do this, I'm creating an offscreen TRichViewEdit, along with a TRVStyle, then appending each of the documents from their streams, using AppendRVSFromStream.

Each time I append a document, I'm getting an error, and RVFWarnings shows:

[rvfwConvUnknownStyles]

I'm setting:
RVFParaStylesReadMode := rvf_sInsertMerge;
RVFTextStylesReadMode := rvf_sInsertMerge;

and I know that the documents themselves are complete and functional, because when I load them into an onscreen TRichViewEdit using LoadRVFFromStream, they appear perfectly.

There must be something I'm missing here.

In case it helps, this is what one of the document streams looks like:

-8 1 3
-7 0 -1 0 0 0 0 536870911
-9 2 0 0 0 0 1
rvsSnippets
0E01095374796C654E616D65060A4E6F726D616C5465787408466F6E744E616D650610417269616C20556E69636F6465204D5305436F6C6F720707636C426C61636B094261636B436F6C6F720707636C57686974650B4E6578745374796C654E6F020007556E69636F6465090001095374796C654E616D65060948797065726C696E6B08466F6E744E616D650610417269616C20556E69636F6465204D53055374796C650B0B6673556E6465726C696E650005436F6C6F720706636C426C75650A486F766572436F6C6F720705636C526564044A756D70090A4A756D70437572736F72070B637248616E64506F696E740B4E6578745374796C654E6F020007556E69636F6465090001095374796C654E616D6506085374796C654E6F32085374616E646172640808466F6E744E616D650610417269616C20556E69636F6465204D53055374796C650B066673426F6C640866734974616C69630005436F6C6F720707636C426C61636B094261636B436F6C6F720707636C576869746507556E69636F6465090001095374796C654E616D6506085374796C654E6F33085374616E646172640808466F6E744E616D650610417269616C20556E69636F6465204D53055374796C650B0866734974616C69630005436F6C6F720707636C426C61636B094261636B436F6C6F720707636C576869746507556E69636F6465090000
-9 2 0 0 0 0 2
rvsSnippets
0E01095374796C654E616D65060F506172616772617068205374796C6504546162730E000001095374796C654E616D65060843656E746572656409416C69676E6D656E74070972766143656E74657204546162730E000001095374796C654E616D6506042E707330085374616E6461726408104261636B67726F756E642E436F6C6F720707636C576869746504546162730E000000
-9 2 0 0 0 0 4
rvsSnippets
0E01095374796C654E616D65061142756C6C6574204C697374205374796C65064C6576656C730E01084C69737454797065071272766C7374556E69636F646542756C6C65740A4C656674496E64656E7402140B4669727374496E64656E74020011466F726D6174537472696E6757436F64650604303042370001084C69737454797065071272766C7374556E69636F646542756C6C65740A4C656674496E64656E7402140B4669727374496E64656E74020011466F726D6174537472696E6757436F64650604303042370001084C69737454797065071272766C7374556E69636F646542756C6C65740A4C656674496E64656E7402140B4669727374496E64656E74020011466F726D6174537472696E6757436F64650604303042370000054C7374494404FD9733110001095374796C654E616D6506134E756D6265726564204C697374205374796C65064C6576656C730E01084C69737454797065070C72766C7374446563696D616C0A4C656674496E64656E7402140B4669727374496E64656E74020011466F726D6174537472696E6757436F6465060C30303235303037333030324510466F726D6174537472696E67436F646506063235373332450001084C69737454797065070C72766C7374446563696D616C0A4C656674496E64656E7402140B4669727374496E64656E74020011466F726D6174537472696E6757436F6465061830303235303037333030324530303235303037333030324510466F726D6174537472696E67436F6465060C3235373332453235373332450001084C69737454797065070C72766C7374446563696D616C0A4C656674496E64656E7402140B4669727374496E64656E74020011466F726D6174537472696E6757436F6465062430303235303037333030324530303235303037333030324530303235303037333030324510466F726D6174537472696E67436F646506123235373332453235373332453235373332450000054C7374494404F6EF50200000
"NormalText" 1 ".ps0" 8 3 0
54006800690073002000770069006E0064006F00770020006900730020007400680065002000
"StyleNo2" 1 -1 9 3 0
550073006500660075006C00200053006E00690070007000650074007300
"NormalText" 1 -1 9 3 0
2000770069006E0064006F0077002E00200041002000
"StyleNo3" 1 -1 9 3 0
73006E0069007000700065007400
"NormalText" 1 -1 9 3 0
2000690073002000610020007000690065006300650020006F00660020007400650078007400200079006F00750020006D0061007900200075007300650020006F00760065007200200061006E00640020006F00760065007200200061006700610069006E002E00200046006F00720020006500780061006D0070006C0065002C00200079006F00750020006D00610079002000660069006E00640020007400680061007400200079006F0075002000740065006E006400200074006F0020007700720069007400650020007400680065002000730061006D00650020006500780070006C0061006E006100740069006F006E00200066006F0072002000610020006700720061006D006D00610072002000700072006F0062006C0065006D00200074006F0020006D0061006E0079002000730074007500640065006E0074007300200065007600650072007900200079006500610072002E00200059006F0075002000630061006E002000730074006F00720065002000740068006100740020006500780070006C0061006E006100740069006F006E00200069006E00200079006F0075007200200053006E006900700070006500740073002C00200061006E006400200075007300650020006900740020006100750074006F006D00610074006900630061006C006C00790020007700680065006E006500760065007200200079006F0075002000770061006E0074002E00200046006F00720020006D006F0072006500200069006E0066006F0072006D006100740069006F006E0020006F006E00200073006E006900700070006500740073002C00200065007800700061006E0064002000740068006500200073006E0069007000700065007400200074007200650065002000610062006F00760065002C00200061006E0064002000720065006100640020006F007400680065007200200074006F0070006900630073002E002000



All help appreciated,
Martin
Sergey Tkachenko
Site Admin
Posts: 17310
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I confirm the problem in RVF insertion (not loading) methods when RVF file was saved with [rvfoUseStyleNames, rvfoSave***Styles] in RVFOptions (i.e. it contains collections of styles and style names are used instead of style indices), and inserted with [rvfoLoad***Styles] in RVFOptions (i.e. collections of styles in these files are not ignored).
It will be fixed in the next update.

Notes:
1) As for me, saving with [rvfoUseStyleNames, rvfoSave***Styles] makes no sense. If collections of styles are saved in RVF file, why not to use indices to access them? Using style names makes sense if collections of styles are not saved in the same file.

2) If you still want to use these options, assign True to RichViewCompareStyleNames (global variable from RVStyle.pas). By default, style names are ignored when comparing styles, so, when merging style collections from the inserted RVF files, if a style with identical attributes but different name already exists, a style from file will not be added, and items using this style will not be read properly.
But before making any editing operation that can add style, you need to reset it back to True temporary.

3) In the current version, list markers do not use style names to save indices in ListStyles. It will be implemented in the next update.
martindholmes
Posts: 131
Joined: Mon Aug 29, 2005 12:03 pm

Post by martindholmes »

Thanks Sergey. I have to save with style names for another section of the application, where these mini-documents share two or three global styles, which must be changed centrally sometimes; so the streams I have are saved with stylenames. I don't need to use the style names when I append them all together, though, so maybe there's a way to stream them into an RVE, and out to a stream again, without the stylenames. That might do the job.

Cheers,
Martin
martindholmes
Posts: 131
Joined: Mon Aug 29, 2005 12:03 pm

Post by martindholmes »

An update on this:

Setting RichViewCompareStyleNames to True doesn't help; the same errors occur. So I'm still a bit stuck here. I guess I'll have to wait for the fix to be released.

Cheers,
Martin
Sergey Tkachenko
Site Admin
Posts: 17310
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Did you update TrichView to the latest version? this problem must be fixed
martindholmes
Posts: 131
Joined: Mon Aug 29, 2005 12:03 pm

Post by martindholmes »

I'm just in the process of doing that. I hadn't noticed the new release.

Thanks,
Martin
Post Reply