Skip to main content
Inspiring
April 23, 2009
Question

[CS4] Removing notes from exported RTF

  • April 23, 2009
  • 1 reply
  • 487 views

When you export a story as RTF any notes in the story are added to the end of the exported rtf.  (It would have been most excellent if the notes were placed where they appear in the story and made invisible).

To avoid having the notes show up in the rtf I use the following:

sequence = CmdUtils::BeginAbortableCmdSeq();

sequence->SetName(PMString("rtf notes"));

Utils<INoteUtils> noteUtils;

noteUtils->ClearAllNotes(inTextModel);

exporter->ExportToFile(idFile, inDocument, textTarget, formatName, kSuppressUI);

CmdUtils::AbortCommandSequence(sequence);

This works except that the story in the ui flashes with the remove/undo-remove notes.

Is there a better way to do this?  Is there some way I can tell the exporter to not write notes?

Thanks

-doug

This topic has been closed for replies.

1 reply

Inspiring
April 23, 2009

I haven't looked at notes in detail from the SDK side, but from the scripting side they appear exactly like you describe them - hidden content straight within the character strand, rather than safely stored away in a separate strand. Side effects include strange findings of grep-search.

Anyway, your approach sounds similar to my first attempt on the task. If you want to get around the flashing, you could either lock the screen against redraws ( I think sprites use such a mechanism when they start their offscreen buffer ) or work on an invisible copy, e.g. duplicate the story into the scrap database before you strip the notes and export. The latter approach sounds slower but as you'd be using a database with a faster ProtectionLevel it could actually be faster, also taking all those note-deleted notifications into account.

Dirk