Page 1 of 1
RTF import/export and pghsxnN
Posted: Wed Dec 23, 2020 3:07 pm
by bastian.turcs
Hello,
I'm using TRichView 16.10.4 to load an rtf that contains the following control word sequence:
Code: Select all
\pgwsxn16838\pghsxn11906\marglsxn1134\margbsxn1417
After importing this rtf and saving it the text as rtf again, this information is lost. It is used to change the page format in the midst of the document.
Is there a way that this commands will not be lost after import and export to rtf?
Thank you for your help,
Basti
Re: RTF import/export and pghsxnN
Posted: Wed Dec 23, 2020 3:53 pm
by Sergey Tkachenko
Sorry, these RTF keywords are not supported.
TRichView can read and write similar keywords, \paperw \paperh \margb, if:
RTFReadProperties.ReadDocParameters = True
rvrtfSaveDocParameters is included in RTFOptions.
Re: RTF import/export and pghsxnN
Posted: Wed Dec 23, 2020 4:28 pm
by bastian.turcs
Thank you for your fast reply. I already use ReadDocParameters and this works fine.
Is it possible to extend rtf reading / writing in some way to persist these control words?
It would be fine if there is no change in the display of the document in the richview control itself, as our customer uses Ms Word later to view and print the file.
I was also thinking of inserting this commands manually somehow before saving. Do you think this is possible?
would be another option..
If there is no way, our custom will have to use the standard page format for all pages.
Re: RTF import/export and pghsxnN
Posted: Wed Dec 23, 2020 6:01 pm
by Sergey Tkachenko
Currently, TRichView supports only global page properties. It does not support sections. All section information, including the properties you mention, will be lost.
While it's possible to implement reading and writing additional RTF keywords (although it's not simple in the current version of TRichView), it does not make sense without context. RTF file can have multiple sections, with multiple \pgwsxn and other keywords.