Copy link to clipboard
Copied
So basically I take PDF's and make them into images so that I can place them in documents. And I do this quite a few times a day.
Looking to find a way to create a quick tool that will do that with one press in Adobe Acrobat Pro DC. Any help would be great, as I tried to make one... but couldn't find my way after navigating all the sub menus.
[Moved from non-technical Forum Lounge to an Acrobat forum... Mod]
[Here is the list of all Adobe forums... https://forums.adobe.com/welcome]
OK, in order to be able to do it you need to create a js file (for example, SaveAsJpeg.js) and place it under Acrobat's JavaScripts folder.
In the file place this code:
...app.addMenuItem({cName: "SaveAsJPEG", cUser: "Save As JPEG", cParent: "File", nPos: 5,
cExec: "myTrustedSaveAsAndConvert(this, this.path.replace(/pdf$/i, \"jpg\"), \"com.adobe.acrobat.jpeg\");",
cEnable: "event.rc = (event.target != null);"
});
safeSaveAsAndConvert = app.trustPropagatorFunction(function(doc,vPath,vConv){
a
Copy link to clipboard
Copied
It's possible to do it using a script. I'll post the code in a moment...
Copy link to clipboard
Copied
OK, in order to be able to do it you need to create a js file (for example, SaveAsJpeg.js) and place it under Acrobat's JavaScripts folder.
In the file place this code:
app.addMenuItem({cName: "SaveAsJPEG", cUser: "Save As JPEG", cParent: "File", nPos: 5,
cExec: "myTrustedSaveAsAndConvert(this, this.path.replace(/pdf$/i, \"jpg\"), \"com.adobe.acrobat.jpeg\");",
cEnable: "event.rc = (event.target != null);"
});
safeSaveAsAndConvert = app.trustPropagatorFunction(function(doc,vPath,vConv){
app.beginPriv();
doc.saveAs({cPath:vPath, cConvID: vConv});
app.endPriv();
});
myTrustedSaveAsAndConvert = app.trustedFunction(function(doc,vPath,vConv){
app.beginPriv();
safeSaveAsAndConvert(doc,vPath,vConv);
app.endPriv();
});
This will add a new menu item to the File menu of Acrobat, called "Save As JPEG", which will export all the pages in the currently open file as JPEG images in the same folder and using the same name (with a "_Page_X" suffix) as the original file. You can play around with the values of the nPos parameter if you want to move it up or down the menu items. You'll need to restart Acrobat after every change you make to it, though.
Copy link to clipboard
Copied
Thank you so much... that was super awesome. One more question, tried finding the code to add a shift + ctrl (key modifier) to do it quickly. Cant seem to find it and place it.
Copy link to clipboard
Copied
That's not possible, I'm afraid. Best you can is add a keyboard accelerator so you could access it using a specific key.
To do that change this part of the code:
cUser: "Save As JPEG"
To this:
cUser: "Save As &JPEG"
You'll then be able to execute it by pressing Alt+F, and then J.
Copy link to clipboard
Copied
That's even better. Thank you again for the code and short cut! You are awesome!