The timeout and interval methods are not needed as of the 10.5 release of PDF-XChange.
The PXEmacro class is mostly covered by the new util.expandMacros method as of the 10.6 release of PDF-XChange https://www.pdf-xchange.com/product/pdf ... 10-6-0-396
These zip files contain the source code for the three main xutil libraries I made:
xutil: My plan was to minify the script, but because this is all loaded locally, I didn't see a need and included the source -- now I think starting to include a minified version would cause confusion so I've always just stuck with including the source. xutil.ClrUtx: This is the color utilities. This one I do use a minified version and call the file xutil.colorUtils.js: xutil.stampDialog: This is the stamp dialog utility. This one I also use a minified version and call the file xutil.stampUtils.js:
This is a pdf with documentation (output by jsDoc): xutil.addBookmark
- Add a bookmark that uses built-in bookmark properties at current page/zoom/position (ie without the limitations of bookmark.setAction())
Uses a saved array of bookmarks and .includes() to find which bookmark was added.
xutil.setTimeout Note that capitalization matches javascript in browsers (the built-in app.setTimeOut() capitalizes 'Out'.)
- These extend the built in app methods to allow one to pass functions. I find this much easier to work with because I can use closures. Instead of returning an object, they return an integer greater than zero on success.
xutil.clearTimeout
- Functions to clear the interval or timeout set with the above functions.
- Get an annotation as soon as it's drawn
- Minimal PDF-XChange macros class for javascript
Class based on Matrix2D but it fixes view rotation and page offsets (in PDF XChange build 386 onwards).
xutil.rotateCoords
Rotate a coordinate array around a point.
xutil.getBounds
Get the min and max coordinates of a coordinate array.
xutil.bxCtr
Get the center point of bounding box (obtained from xutil.getBounds).
xutil.ClrUtx
- Class for color utilities I have used in quite a few scripts. From v2 onwards, it has a dialog that includes color images for a color picker (previously it was limited to just using the color names in a drop-down list). It's documented in the code, but I've also output the jsDoc as a pdf.
- This is the library to make stamp dialogs easier and has functionality to change the color of stamp elements. I've posted extensively about it here: viewtopic.php?t=45879
Licensing
These are all released under the 'MIT license' so you can pretty much do with it as you want. I included a copy of the license in the zip file. The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement.