Hi,
Is there any way to store private data at the document level in an extension?
I need to store persistent xml data at the document level. This data could be larger than 64K in some cases.
I tried to use .insertLabel(key, string) / .extractLabel(key). It works but text gets truncated at around 64K.
This xml data is not meant to be used for tagging and I don't want this data to be accessible via the tag panel. So, without revert to use a plugin, what would be the best approach?
thanks in advance for any cue
JeanrLemay
Hi,
I did some tests few months ago, and noticed that storing data through "insertLabel" only allows about 4K of data.
You can add more, but when you save the document, everything over 4K is flushed.
Maybe you can create series of "insertLabel" data keys depending on data length.
HTH
--
Marijan (tomaxxi)
Thank you Harbs.
XMP data seems to be the way to go.
but for me, it does not look to be a short way. I am not familiar with XMP manipulation from inDesign extension perspective.
I have read the tutorial at
http://www.adobe.com/devnet/creativesuite/articles/handling-metadata.h tml
It gives sample usage for Illustrator but no cue for InDesign. Access to XMPString seems different from the InDesign perspective.
sure I will have to learn more around xmp. Does anybody know of a short tutorial or sample code to start with?
many thanks
JeanRLemay
In the small and very helpful tutorial from Fraser Gregor called
The sample for Illustrator is quite straitforward.
In the run() function, add this line to extract the XMP packet from the active Illustrator document:
var xmpPacket:String = app.activeDocument.XMPString; Create an object to represent our custom art namespace, in the context of the XMP packet:
var context:ArtXMPContext = new ArtXMPContext(xmpPacket); JeanRLemay
No. InDesign provides XMP manipulation directly. You use doc.metadataPreferences.setProperty() and doc.metadataPreferences.getProperty()
If you need your own custom namespace, you can either use the method Marijan explains on his blog, or you can use the XMP Namespace Designer that's part of Extension Builder.
Harbs
North America
Europe, Middle East and Africa
Asia Pacific