Skip to main content
Participating Frequently
August 10, 2017
Question

How to access an object from Acrobat pro XI javascript

  • August 10, 2017
  • 3 replies
  • 1462 views

I have a pdf file which is a scanned image with hand writings on it. It hides and covers some numerical text - it was someone's idea to hide some sensitive information except they did not use the Redaction feature properly. Instead, the numerical text is being covered up by a white strip that resembles an annotation object with white background, but it is not an annotation, layer, field, or an image. The following methods all return 0 or null:

this.numFields

this.getAnnots(0);

this.getOCGs(0);

and when I extract page images that white strip will not be extracted as an image.

I need to access this covering object from javascript and get its rect or quads coordinates in order to overlay some colored annotation object on top of it and make it visible to the user.

In order to "see" the white object, from Edit menu I select Edit Text and Images. Then, I select the page image and resize it by dragging it from upper left corner towards lower right and then I see a number appear in the middle of the form as the image is resized and the white object stays put in its position. The number is hidden by what appears as a while colored annotation, but it is not an annotation.

I tried the "Browse Internal PDF Structure" in preflight but could not make much sense out of it.

Can someone guide me on how can I detect and figure out what this strange and weird object might be and how can I get its rect coordinates.

Any help is much appreciated.

This topic has been closed for replies.

3 replies

Participating Frequently
August 11, 2017

Does anyone know of a method where it can be identified that "hidden texts" exist in a document?

From a privacy perspective it seems very odd and strange that there might not be a way to do that in Acrobat. Inexperienced users may try to hide sensitive information improperly by overlaying grahics or annotations on top them instead of Redacting the document. If you have thousands of documents it is not practical to check them manually one by one, page by page, there must be a way.

Has anyone else had this requirement?

Bernd Alheit
Community Expert
Community Expert
August 11, 2017

You can create a plugin for this. Plugins must be written in C/C++.

Participating Frequently
August 10, 2017

OK so javascript can not access the graphic. How about the following:

Is there a way to reach the rect of the word that was hidden under this graphic. When I run the "Remove Hidden Information" action, that word will be removed so obviously Adobe knows it was a hidden word. How can I identify hidden words from javascript?

Bernd Alheit
Community Expert
Community Expert
August 10, 2017

Not possible with JavaScript.

try67
Community Expert
Community Expert
August 10, 2017

To share a file you need to upload it to a website like Google Drive, Dropbox or the Adobe Cloud, and then post a link to it here.

Participating Frequently
August 10, 2017

Thank you for the tip. Here is a link to the pdf. I have redacted the pdf (green boxes) to protect the innocent.

U9_2 1x_Redacted.pdf - Google Drive

try67
Community Expert
Community Expert
August 10, 2017

This is a bit useless. You redacted that object so I have no way of knowing what it was...