Is there a way to take a PDF that is 300dpi and convert it to 150 or 72dpi?
14 replies
Do you have Adobe's Acrobat Pro app?
Try resave from preview app
Yes, I have Acro pro but this would be for a large group of files and batch processes and pdf optimizing are not scriptable by either applescript or javascript.
Preview is also not scriptable.
I was thinking there might be a way using image events but I don't know much about it.
Preview is also not scriptable.
I was thinking there might be a way using image events but I don't know much about it.
It is possible via JavaScript as of Acrobat 9. You need to look at creating a Pre-Flight in the app then you can call upon that with JavaScript. You optimize as part of the Pre-Flight conditions. You can batch the files with AppleScript then use do JavaScript.
I have Acro pro 7 and 8 but not 9. Is there a way to do it in 8?
What about using "sips" in terminal, have you ever used that?
What about using "sips" in terminal, have you ever used that?
I too am stuck with versions 7 & 8 and its NOT possible to add the optimization to a Preflight. You can save Preflights as droplets (apps) and use then to open and check PDF's but thats about it. Sorry.
Using
sips works for single page pdfs. The usage would be as follows:
*sips -s format pdf -s dpiHeight 72 -s dpiWidth 72 -s formatOptions low /path/to/pdf.pdf --out /path/to/converted/pdf.pdf*
The formatOptions may be low, normal, high, best or a %. There are many different ways to adapt this to AppleScript using "*do shell script*".
*sips -s format pdf -s dpiHeight 72 -s dpiWidth 72 -s formatOptions low /path/to/pdf.pdf --out /path/to/converted/pdf.pdf*
The formatOptions may be low, normal, high, best or a %. There are many different ways to adapt this to AppleScript using "*do shell script*".
Thanks.
This is what I tried...
do shell script "sips -s format pdf -s dpiHeight 72 -s dpiWidth 72 -s formatOptions low Macintosh HD/Users/mkt/Desktop/HR PDF's/A22 351-00-7385 0310.pdf --out Macintosh HD/Users/mkt/Desktop/PA Folder/test.pdf"
This is what I got...
error "sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file" number 2
This is what I tried...
do shell script "sips -s format pdf -s dpiHeight 72 -s dpiWidth 72 -s formatOptions low Macintosh HD/Users/mkt/Desktop/HR PDF's/A22 351-00-7385 0310.pdf --out Macintosh HD/Users/mkt/Desktop/PA Folder/test.pdf"
This is what I got...
error "sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file" number 2
The apostrophe in your "HR PDF's" folder name is throwing things off as well as the spaces and unnecessary "Macintosh HD". Try this instead:
<pre style="width:630px;height:auto;overflow-x:auto;overflow-y:hidden;"
title="Copy this text and paste it into your Script Editor application.">
</pre>
Hope this helps...
<pre style="width:630px;height:auto;overflow-x:auto;overflow-y:hidden;"
title="Copy this text and paste it into your Script Editor application.">
set inFile to quoted form of "/Users/mkt/Desktop/HR PDF's/A22 351-00-7385 0310.pdf"
set outFile to quoted form of "/Users/mkt/Desktop/PA Folder/test.pdf"
do shell script "sips -s format pdf -s dpiHeight 12 -s dpiWidth 12 -s formatOptions low " & ¬
inFile & " --out " & outFile
</pre>
Hope this helps...
Thanks Chachi that works now. The next problem is that this changes the actual size of the document so that when I open it in Acrobat or preview the size is no longer what it used to be. This messes up the following parts of the script. Is there a way to keep it the same size but lower the resolution?
Usally the output resolution can be set when saving the file from the application.
You can use AI to (script) convert if the PDF's are only one page. I strongly recommend getting Acrobat Pro though.
Online I use Image Magick to convert files, It does a super job.
good luck
You can use AI to (script) convert if the PDF's are only one page. I strongly recommend getting Acrobat Pro though.
Online I use Image Magick to convert files, It does a super job.
good luck
You can adjust the size using "
-Z":
<pre style="width:630px;height:auto;overflow-x:auto;overflow-y:hidden;" title="Copy this text and paste it into your Script Editor application.">
</pre>
<pre style="width:630px;height:auto;overflow-x:auto;overflow-y:hidden;" title="Copy this text and paste it into your Script Editor application.">
set inFile to quoted form of "/Users/mkt/Desktop/HR PDF's/A22 351-00-7385 0310.pdf"
set outFile to quoted form of "/Users/mkt/Desktop/PA Folder/test.pdf"
do shell script "sips -s format pdf -s dpiHeight 12 -s dpiWidth 12 -s formatOptions low -Z 800 " & ¬
inFile & " --out " & outFile
</pre>
Handellphp, what do you mean by AI? Also is Acrobat Pro 9 the only version that you can for sure do that in? I'd prefer to use Acrobat Pro too but can't find a way to script it in either v7 or 8.
Chachi, Thanks, that works but it very difficult to get the page size to be exactly what it was before and really degrades the quality.
Chachi, Thanks, that works but it very difficult to get the page size to be exactly what it was before and really degrades the quality.
AI = Adobe Illustrator.
Since you are limited by software.
have you tried to script the "System Events"
example:
tell application "Adobe Reader"
activate
tell application "System Events"
-----do your menu or keyboard command here
keystroke "+" using {command down}
end tell
end tell
Are you able to PRINT/SAVE to a file as a smaller PDF doc.
Since you are limited by software.
have you tried to script the "System Events"
example:
tell application "Adobe Reader"
activate
tell application "System Events"
-----do your menu or keyboard command here
keystroke "+" using {command down}
end tell
end tell
Are you able to PRINT/SAVE to a file as a smaller PDF doc.
Convert PDF to low res PDF