-
1. Re: Get Object Name Using Javascript
Test Screen Name Dec 23, 2016 12:13 AM (in response to saratogacoach)What sort of object exactly? Most objects don't have a name.
-
2. Re: Get Object Name Using Javascript
saratogacoach Dec 23, 2016 5:29 AM (in response to Test Screen Name)I am using Adobe Framemaker to create a guide that is published to Acrobat PDF (using my installed Acrobat DC printer-this is how Adobe Framemaker seems to publish to PDF).
So, if I add a graphic shape (draw a rectangle with a fill) in Framemaker, and would like to create a new script in Acrobat to change that graphic object (change its color, transparency, etc.), I am not sure what to use for an object name that will be recognized and work in Acrobat's Javascript. Not sure how to reference it in the script?
I tested using a drawn rectangle, and when I view it in Acrobat's Content pane, on the page where the rectangle is, the rectangle seems to have 5 "Path" names, each the same name ("Path") one for each side, and the fifth "Path" is the whole rectangle. So, if I wanted to write a script to change a feature (fill, transparency, etc.) for this object, I am unsure how to call this object in the script?
-
3. Re: Get Object Name Using Javascript
try67 Dec 23, 2016 5:44 AM (in response to saratogacoach)1 person found this helpfulNot possible with Acrobat JavaScript.
On Fri, Dec 23, 2016 at 2:29 PM, saratogacoach <forums_noreply@adobe.com>
-
4. Re: Get Object Name Using Javascript
Test Screen Name Dec 23, 2016 6:02 AM (in response to saratogacoach)The drawn content you make with FrameMaker is not bundled into objects, does not have names, and such content cannot have its attributes read or changed from JavaScript at all.
-
5. Re: Get Object Name Using Javascript
saratogacoach Dec 23, 2016 6:16 AM (in response to Test Screen Name)Is there a way to create a graphic object in Acrobat DC, get a name for it and use the name in a script?
For example, I would draw the graphic object (rectangle, circle, etc. ) in Acrobat (if this can be done), get and use its object name in a script added to a button, to let the person viewing the PDF change the background color/fill.
That would also work, if possible?
-
6. Re: Get Object Name Using Javascript
try67 Dec 23, 2016 6:21 AM (in response to saratogacoach)Yes, you can do it using comments (annotations, in their technical name), or form fields (but those are only rectangular).
-
7. Re: Get Object Name Using Javascript
saratogacoach Dec 23, 2016 6:33 AM (in response to try67)How would I get an object name to use in a script?
I tried by using Commenting, drew a blue circle (object name: "Circle"). What is the object name if I want to use it in a script to for example change the fill color to green?
If I create 10 circles on 10 different pages, and each has the same name ("Circle"), how do I identify the "Circle" on page 4 in a script to only change that one circle's fill color? Is it Page4.Circle ?
-
8. Re: Get Object Name Using Javascript
try67 Dec 23, 2016 6:42 AM (in response to saratogacoach)1 person found this helpfulYou need to study the relevant methods of properties relating to
annotations. Each one has a name property with a unique value.
-
9. Re: Get Object Name Using Javascript
saratogacoach Dec 23, 2016 6:58 AM (in response to try67)Thank you.
I'll do some reading. (Hopefully can find this information in the Adobe JavaScript API guide?)
-
10. Re: Get Object Name Using Javascript
try67 Dec 23, 2016 7:05 AM (in response to saratogacoach)1 person found this helpfulCorrect. Focus on the Annotation object and the relevant methods of the Document object (namely getAnnot, getAnnots and syncAnnotScan).
-
11. Re: Get Object Name Using Javascript
saratogacoach Dec 23, 2016 7:54 AM (in response to try67)Thank you.