THIS SCRIPT HAS BEEN DEPRECATED
The same functionality without any external dependencies such as java or sejda, is in this script http://forum.devontechnologies.com/viewtopic.php?f=20&t=21707
This script allows you to clip a whole page (or series of pages) from a pdf and make them into an annotation. It allows for annotations where the documents are not suitable for text annotations, such as graphs or badly ocred documents. Highlights and additions such as notes and lines are kept in the annotation if they are present in the source document. Alternatively the highlights etc can be added to the annotated page.
The basic usage is the same as for this script - [url]Put up Example page]. The script has one additional feature - “Page Range”. If the page range is set to 0 then just the current page will be clipped for the annotation. If the page range is set to -1 then the previous page and the current page will be clipped. If the page range is set to +1 then the current page and the next page will be clipped and so on.
By default the selected text is added to the spotlight comment but this can be turned off.
Installation:
The script requires java and sejda to be installed. Its not hard just follow the instructions below.
How to do install Java:
Download from Oracle: java.com/en/download/mac_download.jsp?locale=en
Verify that it’s installed properly by looking in System Prefs:
Command-Space to open Spotlight, type ‘System Preferences’, hit enter.
Click Java icon in bottom row. After the Java Control Panel opens, click ‘Java’ tab, ‘View…’, and verify that your install worked. You can see a ‘Path’ there also, which you can sub into the commands below in case they are different than mine.
Verify that the version is as you expect (sub in your path as needed):
/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version
(be careful to get the slashes the correct way around. They are important)
Create link from /usr/bin/java to your new install
Open the terminal
sudo ln -fs /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java /usr/bin/java
(note it will ask you for your password but nothing will show while you type. This is standard behaviour)
Sanity check your version:
java -version
(courtesy of: stackoverflow.com/questions/1275 … -version-6)
How to install sejda
Get the sedja java application from sejda.org and unzip it taking note of the directory where you unzipped it to
Open the package bundle and locate the line in main.scpt which reads set sejda to “/Users/XXXX/Downloads/sejda-console-1.0.0.RELEASE” & “/bin” and replace the path to the directory where you unzipped sejda to.
Credits
The gui is built with Carsten Blüm’s Pashua (bluem.net/en/mac/pashua/), and the Pashua runtime is included in the bundle.
sejda.org
korm for inspiration and his sadly deleted scripts without which this wouldnt have been written at all.
Bugs
Numerous I am afraid. If it doesnt work for you, it doesnt work.
One possible cause for failure is some versions of DT not reporting a PDF document as a PDF in applescript (Thanks to jprint714 for being so patient and discovering this)
The UTF-8 conversion from pdf text to normal text is poor and you may have to clean it up afterwards.
Lots of things can cause it to crash (like back slashes in the selected pdf text, or if your date and time format is different to the one the script was written for)
Sorry in advance
Frederiko
Whole page annotation template.scptd.zip (269 KB)