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

add.WatermarkFromText() query...

TecNik
Registered: Feb 25 2008
Posts: 17

Hi there,
 
Hopefully someone might be able to explain this one.
 
A couple of weeks ago I wrote a script that made use of the 'add.WatermarkFromText();' function, all worked fine.
Now when I come to run the same script I get the error:-
 
RaiseError: Incorrect PDEObject type.
Doc.addWatermarkFromText:1:Console undefined:Exec
===> Incorrect PDEObject type.
undefined
 
I've tried to execute a more simplified test from the Javascript Reference, shown below, and I still get the same error?
I've tried this is both Acrobat Pro 8 and 9 and get the same in both.
 
this.addWatermarkFromText("Confidential", 0, font.Helv, 24, color.red);
 
Please can someone tell me if something has changed?
 
Thanks in advance.
 
Regards,
 
Nick

try67
Expert
Registered: Oct 30 2008
Posts: 2398
Try specifiying the actual parameter names, like cText, cFont, etc.

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

TecNik
Registered: Feb 25 2008
Posts: 17
Thanks for the help.

I'd already tried that and got the error hence the simplified version.
I've just tried the code below again to make sure and still get the same error?

this.addWatermarkFromText({
nStart: 1, nEnd: 1,
cText: "xxxx",
nTextAlign: app.constants.align.right,
nHorizAlign: app.constants.align.right,
nVertAlign: app.constants.align.top,
nHorizValue: 200, nVertValue: 200,
nFontSize: 10
});

Are there any other things I can try to track down why this might be occurring.

Thanks,

Nick

try67
Expert
Registered: Oct 30 2008
Posts: 2398
Might be an issue with the file. Did you try to run this on a new, blank file?

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

TecNik
Registered: Feb 25 2008
Posts: 17
Still the same on a new blank document.
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Which version of Acrobat, and which OS are you using?

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

TecNik
Registered: Feb 25 2008
Posts: 17
I'm on a Mac running Snow Leopard (10.6.4) and using Acrobat Pro 8 (8.1.7) and Acrobat Pro 9 (9.3.4).
I've tried the code in both and get the same result.

I've a sneaking suspicion they've both just been updated as both were telling me there were updates and they're not anymore.
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
On what page are you trying to place this watermark?

Does your PDF have 2 pages?

Have you tried the examples in the Acrobat JS API Reference?

Adobe recommends against having 2 versions of Acrobat or Reader on the same system.

Have you tried this on other systems with Acrobat.

This code works for me on a one page or more page PDF to place the watermark on page 1:

this.addWatermarkFromText({
cText: "Confidential",
aColor: color.red,
nStart: 0, nEnd: 0,
nTextAlign: app.constants.align.right,
nHorizAlign: app.constants.align.right,
nVertAlign: app.constants.align.top,
nHorizValue: -200, nVertValue: -200
});

George Kaiser

TecNik
Registered: Feb 25 2008
Posts: 17
Hi George,

Thanks for your help with this query.
I've now tried the code on another mac and that's working ok.

Could there be a preference in Acrobat, be it general or with the debugger, that would cause this error to be thrown?
I'm a little perplexed as to why I'm getting it when I know all was well last week?

Thanks George.

Regards,

Nick
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
Have you tried to repair the installation?

If you need to reinstall, remember to deactivate the version of Acrobat before installing it.

George Kaiser

TecNik
Registered: Feb 25 2008
Posts: 17
Hi George,

Thanks for your help again. I've not tried a new installation yet.
What I have tried is running your code on several macs now, some come up with the same error and some don't?

I'm looking into what updates have been put on the machines recently to see if we can track anything down that way.

Regards,

Nick
TecNik
Registered: Feb 25 2008
Posts: 17
Hi George,

Thanks for your help again. I've not tried a new installation yet.
What I have tried is running your code on several macs now, some come up with the same error and some don't?

I'm looking into what updates have been put on the machines recently to see if we can track anything down that way.

Regards,

Nick
TecNik
Registered: Feb 25 2008
Posts: 17
Hi George,

Thanks for your help again. I've not tried a new installation yet.
What I have tried is running your code on several macs now, some come up with the same error and some don't?

I'm looking into what updates have been put on the machines recently to see if we can track anything down that way.

Regards,

Nick