Skip navigation
Currently Being Moderated

Storing information within a document

Dec 21, 2011 2:53 AM

Tags: #indesign #xml #label #extension #synching #storing

Hi everyone,

 

Is there a proper way to store information within a InDesign document?

I would like my InDesign extension to be able to synchronizes data between a document, and an online database. So in order to do this I would like to store a copy of that database directly in the document most likely in an XML string.

The reason I'd like to embed it in the document is that I want people to be able to share documents and not loose that data.

 

I've looked at labels which seemed to answer this need:

 

app.activeDocument.insertLabel('myData', someXML);

 

But from what I've gathered around the internet, there is a size limitation of 4,854 bytes for a label. While it might be enough for most cases I can easily see the XML being too big.

 

Is there another way of storing data within a document?

Or do you see another approach to this problem?

 

Thanks in advance for your help.

-- Bastien

 
Replies
  • Currently Being Moderated
    Dec 21, 2011 4:45 AM   in reply to B4stien

    Wow. That's a lot of data.

     

    2 ideas:

    1) You can compress the data and store it as a binary string in the label. That might give you more capacity.

    2) You can split the string and store it in multiple labels.

     

    Harbs

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 21, 2011 11:49 PM   in reply to Harbs.

    Yes, a lot of data!

     

    It's interesting that you can write even more (I wrote about 1 Mb),

    but everything over 4,854 is flushed during the save.

    http://indisnip.wordpress.com/2010/07/31/saving-script-data-within-doc ument/#comment-511

     

    --

    Marijan (tomaxxi)

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 21, 2011 11:57 PM   in reply to Marijan Tompa

    Hi, would storing the data in the XMP packet for the document be an option?

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 22, 2011 12:16 AM   in reply to Adrian OLenskie

    Hey Adrian,

     

    Maybe that could be an option,

    but then he needs to encrypt the data for sure,

    because user can easily read the contents of XMP.

    Is there any size limitations?

    He could just create custom namespace and push the data in.

     

    --

    Marijan (tomaxxi)

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 22, 2011 12:31 AM   in reply to Marijan Tompa

    I don't know of any size limitations (but that might be more a function of my ignorance). We built some tooling into Extension Builder that should greatly simplify this area (including encryption). See Fraser's excellent blog:

    http://www.adobe.com/devnet/creativesuite/articles/handling-metadata.h tml

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 22, 2011 1:21 AM   in reply to Marijan Tompa

    XMP is probably a very good way to handle it!

     

    If you care about data encryption, labels are no better.

     

    All document labels are written into the desingmap of an IDML document...

     

    Harbs

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points