Logout Developer Knowledgebase Search Adobe Partners Main Adobe Solution Partner Finder Adobe Solution Partner Program Support Developer Knowledgebase Adobe Solution Partner Program Products & Technology Adobe
Developer Knowledgebase

Knowledgebase HomeInDesign KB

Overview
Software Development Kits
Developer Knowledgebase
Support
Legal Notices
Feedback
Adobe Solution Partner Program
Join
Find a Solution Partner

Product
InDesign
 
Version
1.0J, 1.5, 2.0, 2.0J, CS
 
Last Edited
28-Jan-2005
 
Document
50054

How To: Protect custom data that your plug-in writes to a document

Summary
Adobe(R) InDesign(TM) allows you to protect any custom data written by your plug-in when the document is opened in an environment without your plug-in. You can provide warnings and/or a FixUpData function to handle repairs.

Issue
My plug-in writes custom data to InDesign documents. How do I prevent problems if an end-user opens the document in an environment without the plug-in?

Solution
Your plug-in stores data as ClassIDs and ImplementationIDs and can specify the importance of each ID. There are 3 levels of importance:
  • Default
    Tells the end-user that the document contains data from a missing plug-in. The default warning message asks if they want to continue the open, and opens the original document if they decide to continue.
  • Critical
    Tells the end-user that the document contains data from a missing plug-in, and strongly advises them not to open the document. They can choose to continue, in which case the application opens a copy of the original as an untitled document to try to preserve the information.
    This is done by adding a CriticalTags resource in your ODFRC Resource file. (See objectmodeltypes.fh for details.). This is how you would specify this in InDesign 2.x and CS.

    resource
    CritcalTags(1)
    {
        kImplementationIDSpace,
        {
            kMyAdditionalPersistentDataImpl,
        }
    }
    ;

  • Ignore
    Doesn't put up a warning message and proceeds with the open as if the plug-in isn't missing. This is done by adding an IgnoreTags resource in your ODFRC resource file. (See objectmodeltypes.fh for details.). This is how you would specify this in InDesign 2.x and CS.

    resource IgnoreTags(1)
    {
        kImplementationIDSpace,
        {
            kMyAdditionalPersistentDataImpl,
        }
    };

You can supply a custom IPlugIn::FixUpData() method in your plug-in if there are checks your plug-in can do on opening a document that has been edited without your plug-in, to bring its data back in sync.

WARNING:
The IgnoreTags are generally safe to use for preferences, which are typically used only by the plug-in that adds it. However, if you are adding persistent data to other types of boss classes, like the FrameLabel sample plug-in is doing, you should use some extra precautions to make sure that the additional persistent data from your plug-in isn't referred to by other subsystems in InDesign. Please note that the FrameLabel sample plug-in also calls the AddPageItemAdornmentCmd command, which adds the adornment boss class (by UID) into the list of adornments for a page item. This is also persisted into the document. If you do not have the plug-in that knows how to handle the adornment, the behavior may be unpredictable.

back to top
Was this Knowledgebase document helpful? Yes  No
The articles in this knowledgebase are intended for use by software programmers currently using an Adobe SDK to extend or customize an Adobe product. These articles may be highly technical in nature.
If you have questions about an Adobe Product that are not related to development or an SDK product please visit: http://adobe.com/support/main.html
Copyright © Adobe Systems Incorporated. All rights reserved.
Terms of Use
Online Privacy Policy