Z
Z
zveb2017-12-06 07:07:09
Adobe Acrobat
zveb, 2017-12-06 07:07:09

How to handle JSObject error from vbs script?

I have a vbs script that puts watermarks on pdf files. It works, but when a signed pdf comes across I
get an error. VBS "On Error Resume Next" doesn't catch the error... How to handle the situation?
Below is a piece of code and an error

...
Set objPDDoc = CreateObject("AcroExch.PDDoc")
objPDDoc.Open(dpath & fileobj.Name)
Set jso = objPDDoc.GetJSObject
Call jso.addWatermarkFromText("text", jso.app.constants.align.left,  "Arial", 14, jso.Color.blue, 0, jso.numPages, True, True, True, jso.app.constants.align.left, jso.app.constants.align.bottom, 0.4, 35, False, 0.9, False, 0, 1)
...

Breaks on the line with 'Call jso.addWatermarkFromText')
---------------------------
Windows Script Host
---------------------------
Script: C:\pdf_sign_frd\print_sign.vbs
Line:   463
Char:   4
Error:  NotAllowedError: Запрещен доступ к данному свойству или методу.
Code:   800A03E9
Source: Acrobat JavaScript

Answer the question

In order to leave comments, you need to log in

Similar questions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question