G’day all.
I’ve finally got a Java Scruipt that saves the individual pages of a PDF.
Shane was quite correct, saving as a trimmed PDF DOES NOT WORK, so I’m saving as TIFFS.
The quality is perfect, so I assume they must be high resolution TIFFS.
The only problem atm is they save as .pdf.tiff extensions, so I’m looking for a way of getting the original file name sans the extension.
If necessary, I’ll pass the trimmed name via a variable.
BUT, it works, and is FASSSSST!
A real hassle in the inability of Java to determine the path to the desktop, from within Acrobat, so it must be passed as a variable.
Regards
Santa
tell application "Finder" set pp to (POSIX path of (path to desktop) as text) open file ((path to desktop as text) & "AuburnAlumni LifetimeAchievement LARGE DIE LINE 121616_104500.pdf" as alias as text) end tell tell application "Adobe Acrobat" activate tell document 1 set theScript to my setDrawPages(pp) do script theScript end tell
end tell
on setDrawPages(pp) set Params to "" set Params to Params & "var dEnd = this.numPages;" & return as text set Params to Params & "var cFlName = this.documentFileName;" & return as text set Params to Params & "var outputPath = " & "\"" & pp & "\";" & return as text set Params to Params & "var outputPathTwo = outputPath " & " + \"" & "Temporary Acrobat TIFFS" & "\"" & " + " & "\"" & "/" & "\";" & return as text set Params to Params & "for (i = 0; i < dEnd ; i++ ){;" & return as text set Params to Params & "var _oNewDoc_ = this.extractPages(i,i);" & return as text set Params to Params & "var tempText = outputPathTwo " & " + " & "\"" & "Page " & "\"" & " + (i + 1) + " & "\"" & " of " & "\"" & " + cFlName" & return as text set Params to Params & "oNewDoc.saveAs({cPath: outputPathTwo + " & "\"" & "Page " & "\"" & " + (i + 1) + " & "\"" & " of " & "\"" & " + cFlName + " & "\"" & ".tiff" & "\"" & ", cConvID:" & "\"" & "com.adobe.acrobat.tiff" & "\"" & "});" & return as text set Params to Params & "};" & return as text return Params as text end setDrawPages
|