Hello,guys
We want to craet a form in PDF. The content of this form has to follow the XML file which is embeded in PDF as an attachment. Therefore, when we update the XML, the form should also be updated automatically. Can JavaScript have the ability to do this? We try to get the path of the embeded file, but failed.
This is the reference we find on this community: Please take a look of the PDF "Bill of Materials"from Adidas
http://www.acrobatusers.com/tech_corners/3d/3d_gallery/index.php?galleryimage=3
We also analysised a lot of samples, but can't get the script which is embeded inside the "Defult Script" when we import a 3D object into PDF.
These two problems are critical to our research, thanks for your help!
Best Regards,
To get an attachment's data:
var stmDO = this.getDoatObjectContents("MyXML");
var strXML = util.stringFromStream(stmDO);
var oXML = XMLData.parse(strXML);
The "XMLData" object does not handle namespaces.
Here's a sample file that shows more of how to do this:
http://www.windjack.com/PDFSamples/XMLDataObjDemo.pdf
For the JS code to work the attached file must have a DataObject Name. The only way to do this is to write JS code to import the XML attachement, you can't do it from the Acrobat UI.
As for 3D. Once the script is attached to the 3D Annotation, there is no UI in Acrobat for editing or extracting it. It's a one way trip. The only way to extract the script is with a tool like PDF CanOpener
http://www.windjack.com/products/pdfcanopener.php
, which is a PDF COS level editor.
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script