Bad RTF table causing RichView to error

General TRichView support forum. Please post your questions here
jgkoehn
Posts: 322
Joined: Thu Feb 20, 2020 9:32 pm

Re: Bad RTF table causing RichView to error

Post by jgkoehn »

One clarification I believed initially this was RTF table related, it is not nothing to do with RTF. I am sorry for that confusion.
Sergey Tkachenko
Site Admin
Posts: 17878
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Bad RTF table causing RichView to error

Post by Sergey Tkachenko »

The error occurs on drawing a document (not a background), and the only reason I can imagine is desynchronization between the document items and formatting information (the latter is updated when you call Format).

In your code, the most probable reason for this is

Code: Select all

reader.RVData.NormalizeDocument(0,True)
This method may remove some unnecessary document items.
You need to call Format after it, not before.
jgkoehn
Posts: 322
Joined: Thu Feb 20, 2020 9:32 pm

Re: Bad RTF table causing RichView to error

Post by jgkoehn »

This does seem to work thank you.

Code: Select all

  reader.RVData.NormalizeDocument(0,True);
  reader.format;
Post Reply