Copy link to clipboard
Copied
In the Javascript for Acrobat 3D Annotations API, I am told I can do this:
faceRes = new Resource ("pdf://picture.jp");
and that the syntax for creating a Resource is:
new Resource (pathname)
where pathname is "a string representing the path of the file or stream. Can only load embedded resources from within the PDF file."
My question is how do I do that? How do I embed resources into the PDF file so I can do this in my Javascript code?
I know this question has been asked many times before. I looked through those discussions in the hope that it is answered but alas they are not.
Most of the answers I found were simply saying, "use this plugin" or "that's beyond the typical GUI user" or "you need to know how to code".
The plugin was probably the closest I could have gotten to an actual answer but the links were broken.
I could neither try to use them nor look through the source.
Thanks in advance!
Copy link to clipboard
Copied
It seems from the answers that a plug-in has to be written. It looks as though nobody has chosen to share or sell a plug-in to do this. If you want to write a plug-in we can probably help you find the Cos objects where they are stored, but not to actually write it.
Copy link to clipboard
Copied
If that's what it takes, I can probably take the time to write a plug-in.
Knowing the COS objects would be helpful, indeed.
I'm thinking it's going to be an XObject? Whether it is or not, I'd also like to know where in the hierarchy they should be.
Thanks!
Copy link to clipboard
Copied
Unlikely to be an XObject. I'll try and research this.
Copy link to clipboard
Copied
When you are creating the 3D annotation, you can attach resources through the Acrobat UI by selecting the "Resources" tab in the 3D advanced settings. The root of the resources tree can be addressed using the prefix "pdf://" but you can also add directories full of files that would be addressed via their path relative to "pdf://".
There are no Acrobat JavaScript APIs to add these resources programmatically via JavaScript but you can with other APIs or plugins but a plugin is not required. Images get stored as PDF XObjects but can be used as though they are whatever image format they were sourced as.
If you want to see an example of a Java application inserting an image into the resources dictionary, see the sample bellow...
http://blogs.datalogics.com/2016/01/27/creating-3d-pdf-files-using-the-datalogics-pdf-java-toolkit/
Disclaimer: I am an Evangelist at Datalogics.
Copy link to clipboard
Copied
I'm looking to add resources programmatically on PDF creation or while it is open so the UI option is not for me. Others can certainly benefit from this information though.
I see. I'll look into their storage as XObjects.
Thanks for the link to the sample!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more