in reply to Re^4: PDF::Reuse - adding javascript
in thread PDF::Reuse - adding javascript
Standalone javascript interpreters verify the syntax is ok, although I can't test much else (because the "this" object refers to the Adobe doc object.
There is always a way to test! You can create a mock object of the Adobe DOM. It looks like you have only a few calls to it, and it returns some sort of form element object (which you can also mock up). And not only will this allow you to test this outside of Acrobat, but it will also help by getting you more familiarized with the Adobe DOM itself. Here is a basic mock up, which (if my Javascript knowledge is not too rusty) should work and deal with the "this" in your code properly as well.
function MockAdobeDOM () { // ... any bookkeeping code you want here } MockAdobeDOM.prototype.addField = addField; MockAdobeDOM.prototype.nameAddress = nameAddress; function addField (fieldName, fieldType, thePage, myRec) { // return mock field object you are asking for } function nameAddress(page, xpos, ypos) { // ... your code here ... }
|
|---|