To use, unzip and copy the .js file to the JavaScripts folder and restart PDF-XChange. You can test it out by copy and past the code into the javascript console (CTRL-J) and run it from there.
It will add a menu item "Draw Regular Polygon…" to the Comments menu, or if you are using the ribbon UI it will add it to the end of the File menu. Select that menu item and it opens a dialog box:
Enter number of sides (at least 3), scale (this is the radius of a circle that circumscribes the polygon), and angle. It will draw the polygon in the center of the current page: You can change border color, style, fill, size, etc just as you would for any other markup - it's a Polygon annotation.
The option "Draw as Star" draws a star shape. This is a 6 sided polygon as a star: There's an option in the javascript file on line 26 to change how spiky the star is. It's the ratio of the radius at the inside of the star. A smaller number will make it extend in closer to the center:
Code: Select all
// factor to scale inner point of star
const starShape = 0.5;