• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Can Acrobat PDF's be saved as single pages via Applescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can Acrobat PDF's be saved as single pages via Applescript


  • Subject: Re: Can Acrobat PDF's be saved as single pages via Applescript
  • From: Brian Christmas <email@hidden>
  • Date: Fri, 13 Jan 2017 12:39:06 +1100


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

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Can Acrobat PDF's be saved as single pages via Applescript
      • From: Shane Stanley <email@hidden>
References: 
 >Can Acrobat PDF's be saved as single pages via Applescript (From: Brian Christmas <email@hidden>)

  • Prev by Date: Re: Coercing ligatures to expanded characters
  • Next by Date: Re: Can Acrobat PDF's be saved as single pages via Applescript
  • Previous by thread: Re: Can Acrobat PDF's be saved as single pages via Applescript
  • Next by thread: Re: Can Acrobat PDF's be saved as single pages via Applescript
  • Index(es):
    • Date
    • Thread