These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

How to retrieve the water mark .

warningz
Registered: Jun 24 2010
Posts: 3
Answered

this.addWatermarkFromText({
cText: "Hello" ,
cFont: "AngsanaUPC" ,
aColor: ["RGB", 1, 0, 0] ,
nTextAlign: app.constants.align.center,
nHorizAlign: app.constants.align.center,
nVertAlign: app.constants.align.top,
nHorizValue: -50,
nVertValue: -72 ,
nOpacity: 0.1 ,
});

}

from code above i add text "Hello" as the watermark . I have seen in javascript API reference that addWatermarkFromText(); will places the watermark in an optional content group (OCG).

my question is how can i get the text "Hello" back from watermark in document.

My Product Information:
Acrobat Pro 9.3.1, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2399
The document object has a method called getOCGs which will return an array of all OCGs in the file.
However, I don't think you can use that to retrieve the actual text in the watermark.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
try67's correct - although there is an API call to return the Nth word on a page, and another one to return an array of OCG objects, the two functions aren't linked - so you can't return a string containing a word from a particular layer.

What are you trying to achieve? Surely if you're programmatically embedding the watermark, you already know the text string?
warningz
Registered: Jun 24 2010
Posts: 3
Thanks for the suggestions.

I'm trying to create a plug-in which takes data from the user fills out a form. To encode and insert a watermark, then the process must validate the document. By adding a watermark embedded data is compared. Information in the form has been submitted.
But I still do not know whether to retrieve the watermark .