Highlighted

Javascript API access to language, tagged properties

New Here ,
Sep 01, 2020

Copy link to clipboard

Copied

Does the Javascript API allow getting/setting these document properties:

  • reading language
  • tagged PDF

I can't see anything obvious in the May 2015 API reference.

 

 

Topics

Acrobat SDK and JavaScript

Views

30

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Javascript API access to language, tagged properties

New Here ,
Sep 01, 2020

Copy link to clipboard

Copied

Does the Javascript API allow getting/setting these document properties:

  • reading language
  • tagged PDF

I can't see anything obvious in the May 2015 API reference.

 

 

Topics

Acrobat SDK and JavaScript

Views

31

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Sep 01, 2020

Copy link to clipboard

Copied

Is this inquiry related to accessibility?

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
New Here ,
Sep 01, 2020

Copy link to clipboard

Copied

It is -- I am developing Javacript actions for an Action Wizard. The goals are to:

  • Set the document language to English, but only if it's not already set.
  • Call the Autotagger only if the document is not already tagged. However: it looks as though the "Autotag Document" action already behaves this way.

Another goal:

  • Create bookmarks from structure without prompting to select the tags.

Is it possible to iterate over the tags in the document?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Sep 01, 2020

Copy link to clipboard

Copied

  • It is -- I am developing Javacript actions for an Action Wizard. The goals are to:
  • Set the document language to English, but only if it's not already set.
    Call the Autotagger only if the document is not already tagged. However: it looks as though the "Autotag Document" action already behaves this way.

 

These are not really my areas of expertise, but I can say that, yes, the built-in feature in the Action Wizard can take care of this. I don't think that JavaScript is needed. For the Autotagging action yuo may also want to incorporate the Accessibility Checker as an action (under the same action--- you can combine various actions into one, and run them in a specied sequence). The Accessibility Checker will handle auto-tagging, checking the language, generating a report  (which allows to perform manual  fixes (if needed)) and possibly even fix bookmark structure.

 

See here: https://helpx.adobe.com/acrobat/using/create-verify-pdf-accessibility.html

 

If you run into problems due to changing tcontent objects you may need to address this manually. See here: https://helpx.adobe.com/acrobat/using/editing-document-structure-content-tags.html 

 

 

  • Another goal:
  • Create bookmarks from structure without prompting to select the tags.
  • Is it possible to iterate over the tags in the document?

 

You can use the built-in auto tagging feature as mentioned above for this. However, in my humble opinion, perform this action silently you may not catch if an error is encountered during the procedure.

 

About the iteration over the tags in a document, I am not sure if this is even possible with JavaScript, but it seems to be possible to iterate over bookmarks (if this is what you meant), which is described in detail in this topic with a javascript example: https://answers.acrobatusers.com/Change-bookmarks-javascript-q73866.aspx

 

In particular, check Karl Heinz Kremer's answer in that thread : "You need to iterate over all bookmarks and then set the name approprately. The documentation for the "children" property has sample code that shows how to iterate over all bookmarks"

 

And also check the script that try67 provided in that link.

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
ls_rbls LATEST
Adobe Community Professional ,
Sep 01, 2020

Copy link to clipboard

Copied

And check this other thread with a solution provided for another user by Thom Parker:

 

https://community.adobe.com/t5/acrobat/javascript-to-split-top-level-bookmarks-using-bm-names-for-fi...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Resources
One Stop Solution for Acrobat
Edit a PDF