Skip to main content
Participating Frequently
June 23, 2020
Question

How to get and replace auto generated tags with contents by using javascript

  • June 23, 2020
  • 2 replies
  • 1198 views

Hi,

Please help me to get the auto tagged contents with the tag and also to replace the PDF content by using the adobe javascript. In this script have only option to get the content. So kindly help me to solve this issue.

This topic has been closed for replies.

2 replies

Legend
June 24, 2020

Also, JavaScript can read the words but it cannot change the page content.

arunraj.cAuthor
Participating Frequently
June 24, 2020

Thanks for the reply.

Is there any possibility to fetcth/update the tags in Acrobat DC without using manual?

Legend
June 24, 2020

Updating tags can be done by writing a plugin in C/ C++. Editing page contents and/or accessibility tags is a very advanced topic and needs a full and detailed understanding of the PDF specification ISO 32000 as well as its abstraction in the API. Full experienced knowledge of PDF/UA and other published and de facto accessibility standards is recommended, as well as cross checking with the most popular tools. 

Bernd Alheit
Community Expert
Community Expert
June 23, 2020

What script does you use?

arunraj.cAuthor
Participating Frequently
June 24, 2020

Hi Bernd,

 I have used below code to get the content (Acrobat DC script).

 

var p = this.pageNum; 
var n = this.getPageNumWords(p);
app.alert("Number of words in the page: " + n);

var str = "";
for(var i=0;i<n;i++) {
  var wd = this.getPageNthWord(p, i, false); 
  if(wd != "") str = str + wd; 
}
app.alert(str);

 

This code is used to get the content only. Is ther any possible to fetch the tagged content with tag like XML?

Bernd Alheit
Community Expert
Community Expert
June 24, 2020

Not possible with Javascript.