Huge RTF Report File with State Diagrams

Issue:

The RTF report file generated by CANdelaStudio becomes very huge (> 10 MB) if it contains state diagrams and is saved to RTF or DOC (not DOCX) format.

Solution:
Workaround 1: suppress automatic update of fields in RTF

In CANdelaStudio, uncheck Tools|Options|Specification|Automatically update fields…. Export to the RTF file. Open the generated RTF file in Word, save it in DOCX format, only then update fields (e.g. using keys <Ctrl-A>, then <F9>) and save the file again. Or use any other suitable application to process the RTF file.

Workaround 2: suppress duplication of graphics by Word

In Windows, adapt your registry manually to set under
HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Word\Options
ExportPictureWithMetafile=0.

Background:

With the option (described in workaround 1) checked, CANdelaStudio runs Microsoft Word to update all fields within the generated RTF file. Updating fields in an RTF file that contains images (like state diagrams) lets the file become huge when you save it to Rich Text Format (RTF) or to Word 6.0/95 format (DOC).

This functionality is by design in Microsoft Word. If an EMF, a PNG, a GIF, or a JPEG graphic is inserted into a Word document, when the document is saved, two copies of the graphic are saved in the document:

  1. the original graphic (in EMF, PNG, GIF, or JPEG format) and
  2. a copy in the WMF (Windows Metafile) format.

The resulting RTF file may be bigger by a factor of 10 or even more.

A Windows registry setting controls whether Word actually adds the WMF graphics copy. If you turn this off, some other applications (like Microsoft WordPad) will fail to display the images in the generated RTF file.



Article ID: 448
Last updated: 2019-12-12
Revision: 6
CANdelaStudio -> Import and Export -> Huge RTF Report File with State Diagrams
https://kb.vector.com/entry/448/