{"id":811,"date":"2019-05-07T14:53:26","date_gmt":"2019-05-07T21:53:26","guid":{"rendered":"http:\/\/10.0.1.201\/?p=811"},"modified":"2019-05-07T14:53:26","modified_gmt":"2019-05-07T21:53:26","slug":"convert-pdf-to-jpeg-using-old-version-of-acrobat","status":"publish","type":"post","link":"https:\/\/strawhousepig.net\/wordpress\/2019\/05\/07\/convert-pdf-to-jpeg-using-old-version-of-acrobat\/","title":{"rendered":"Convert PDF to JPEG using (old version of) Acrobat"},"content":{"rendered":"<p>This script will use Acrobat&#8217;s built in conversion settings (set in Acrobat&#8217;s preferences) to convert an open PDF to a new JPEG file and place that file in the folder of said PDF. If a file with the same name (including extension) exists it will prompt for a new name, at which point you may enter a new name or keep it the same and replace the old file.<\/p>\n<p>Not allowing Acrobat to name the new file because, on Macintosh, Acrobat has a ridiculously low character limit when auto-generating a file.<\/p>\n<p>Has not been tested with multi-page PDF&#8217;s, but I do not think it will handle them correctly <ins datetime=\"2019-05-08T22:42:04+00:00\">[it does not]<\/ins>. Acrobat will do it, but the extra file shuffling will not. Also unknown if having a window (document) minimized will cause any shenanigans.<\/p>\n<p>Also note this is written for Acrobat 7. Why? Because old hardware needs old software.<\/p>\n<p><ins datetime=\"2019-05-08T19:04:42+00:00\">[UPDATE] Changed to allow multiple selections.<\/ins><\/p>\n<p><code>tell application \"Adobe Acrobat 7.0 Professional\"<br \/>\ntry<br \/>\n\tset _docs to name of every document<br \/>\n\tif (count of _docs) is greater than 1 then<br \/>\n\t\tset _docs to (choose from list _docs with prompt \"Select file(s) to convert:\" with multiple selections allowed) as list<br \/>\n\tend if<br \/>\n\trepeat with i in _docs<br \/>\n\t\tset _doc to (every document whose name is i)<br \/>\n\t\tset _path to file alias of item 1 of _doc<br \/>\n\t\tset _temp to (path to temporary items folder as text) & \"acrobat_tmp_jpg\"<br \/>\n\t\tsave item 1 of _doc to file _temp using conversion \"com.adobe.acrobat.jpeg\"<br \/>\n\t\ttell application \"Finder\"<br \/>\n\t\t\tset _name to (text items 1 thru -5 of i) & \".jpg\"<br \/>\n\t\t\tset _proof to ((container of file _path) as text) & _name<br \/>\n\t\t\tif (exists _proof) then<br \/>\n\t\t\t\tset _name to text returned of (display dialog \"File '\" & _name & \"' already exists. Please enter a new name (or leave the same to replace):\" default answer _name as text)<br \/>\n\t\t\t\tset _proof to ((container of file _path) as text) & _name<br \/>\n\t\t\tend if<br \/>\n\t\t\tdo shell script \"mv \" & quoted form of POSIX path of _temp & \" \" & quoted form of POSIX path of _proof<br \/>\n\t\t\treveal file _proof<br \/>\n\t\tend tell<br \/>\n\tend repeat<br \/>\nend try<br \/>\nend tell<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This script will use Acrobat&#8217;s built in conversion settings (set in Acrobat&#8217;s preferences) to convert an open PDF to a new JPEG file and place that file in the folder of said PDF. If a file with the same name (including extension) exists it will prompt for a new name, at which point you may [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[10,23,28],"class_list":["post-811","post","type-post","status-publish","format-standard","hentry","category-code","tag-applescript-2","tag-macintosh","tag-os-x"],"_links":{"self":[{"href":"https:\/\/strawhousepig.net\/wordpress\/wp-json\/wp\/v2\/posts\/811","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/strawhousepig.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/strawhousepig.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/strawhousepig.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/strawhousepig.net\/wordpress\/wp-json\/wp\/v2\/comments?post=811"}],"version-history":[{"count":0,"href":"https:\/\/strawhousepig.net\/wordpress\/wp-json\/wp\/v2\/posts\/811\/revisions"}],"wp:attachment":[{"href":"https:\/\/strawhousepig.net\/wordpress\/wp-json\/wp\/v2\/media?parent=811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/strawhousepig.net\/wordpress\/wp-json\/wp\/v2\/categories?post=811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/strawhousepig.net\/wordpress\/wp-json\/wp\/v2\/tags?post=811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}