I frequently need to scale stamps to overlay on drawings (usually stamps of sections of other drawings to compare differences). I made this tool to help scaling to fit.
To install, extract the zip file and save the contents to the Javascripts folder either in %APPDATA%\Tracker Software\PDFXEditor\3.0\ or in %PROGRAMFILES%\Tracker Software\PDF Editor
It adds a toolbar button to the add-ins toolbar. It also adds a menu item to the Ribbon UI at Home > Selection (and in the Edit menu for the classic UI):
To use it, select the markup(s) you want to scale, and click the button. It should open a dialog: Choose the options that you want to change on the selection, and press 'OK'
It should activate the arrow tool.
Draw the first arrow starting from a base point in the selected annotation, to a reference length on the annotation. Draw the second arrow from the new base point to the length you want the annotations scaled to. It should immediately scale the selected annotations.
If you chose to move it to the second origin it will also move it to the second start point.
If you chose to rotate it, it will rotate from the angle of the first line to the angle of the second line. It works by scaling the .rect property of the annotations, changing the .rotation property, and (for lines and callouts) moving the points. Let me know if you see problems.
Limitations
- It scales equally in the x and y direction, using the relative lengths of the two lines drawn (not of their relative x and y differences).
- I don't know an easy way to cancel the tool once it's started. If you pick the tool again, it will cancel. Also if you pick the rectangle tool, or some non-line tool and draw with that, it will usually catch it. I've tried to fail gracefully, but let me know if it does something bad.
TL;DR
Getting the two lengths is difficult because javascript in PDFXChange doesn't have a way to interactively get points in the drawing, or pick areas, etc. I've worked around by setting up a timeout that waits until a new annotation is drawn, then grabbing that annotation and starting a new function.