RTF import/export and pghsxnN

General TRichView support forum. Please post your questions here
Post Reply
bastian.turcs
Posts: 3
Joined: Fri Nov 13, 2020 8:08 am

RTF import/export and pghsxnN

Post 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
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: RTF import/export and pghsxnN

Post 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.
bastian.turcs
Posts: 3
Joined: Fri Nov 13, 2020 8:08 am

Re: RTF import/export and pghsxnN

Post 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?

Code: Select all

\lndscpsxn
would be another option..

If there is no way, our custom will have to use the standard page format for all pages.
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: RTF import/export and pghsxnN

Post 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.
Post Reply