You can also run the script from the Javascript console to temporarily add the button.
Use:
The script adds a button to the Add-on toolbar to toggle hiding/restoring annotations. It works by moving the annotations off the visible area of the page (by the dimensions of the crop box).
If you have annotations selected, it will only isolate (hide) the selected annotations, otherwise it will isolate all annotations on that page EXCEPT for redaction annotations. It adds a temporary hidden Text annotation to the page with the data for which annotations were moved, and how far. If you accidentally delete this, the script will not be able to restore the annotation positions. You can see this annotation in the Comments pane by changing Options... > Show > Show Comments with Hidden Flag
To bring annotations back, press the toolbar button (or select Tools > Hide/Restore Annots) again.
Options:
- By default it adds 50 pt to the x and y dimensions of the crop box to the move distance. To add more padding to the distance it temporarily moves the annotations, edit [ 50, 50 ] line 34:
Code: Select all
const ISOLATE_DIST = [ 50, 50 ]; // additional pts to move annotations past crop box
- To prevent it from also moving locked annotations, change line 35 to false:
Code: Select all
const ISOLATE_LOCKED = false; // false to leave locked comments alone
- It adds a text item to the page with the data on moved items. If this gets deleted, the tool will not restore the item positions - you'll need to do it manually.
- It adds a rather long list of undos. Because of the inconsistent way that PDFX-Change adds undos during Javascripts, undo may not undo everything correctly (ie the added text item with data will not add an undo for its creation, but when it's deleted after everything is moved back, that's added to the undos.)
- There's no dialog to change options, it's just a toggle, so may be a bit opaque. It should add a comment on the JavaScript console each time you run it describing what it tried to do.
- Annotations that extend off the page may not get completely hidden - I may update in future to also check the bounds of all annotations.
