• 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: Yvan KOENIG <email@hidden>
  • Date: Sat, 07 Jan 2017 17:24:34 +0100

You may download the script available at : http://piyocast.com/as/archives/4176
then replace the loop commented by : --PDFをページごとに分割してJPEGでファイル書き出し

by this code in which I highlighted the few changes applied.:
--PDFをページごとに分割してTIFFでファイル書き出し
repeat with i from 0 to (pCount - 1)
set thisPage to (aPDFdoc's pageAtIndex:(i))
set thisDoc to (current application's NSImage's alloc()'s initWithData:(thisPage's dataRepresentation()))
if thisDoc = missing value then error "Error in getting imagerep from PDF in page:" & (i as string)


set theData to thisDoc's TIFFRepresentation()
set newRep to (current application's NSBitmapImageRep's imageRepWithData:theData)
set targData to (newRep's representationUsingType:(current application's NSTIFFFileType) |properties|:{NSTIFFCompressionNone:1})
set zText to retZeroPaddingText((i + 1), 4) of me
set outPath to addString_beforeExtensionIn_addingExtension_("_" & zText, aPOSIXpath, "tiff")


(targData's writeToFile:outPath atomically:true) --書き出し
end repeat

You will get a script splitting the PDF selected in a choose file dialog into TIFF files.


Yvan KOENIG running Sierra 10.12.2 in French (VALLAURIS, France) samedi 7 janvier 2017 17:23:02



 _______________________________________________
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: Brian Christmas <email@hidden>
    • Re: Can Acrobat PDF's be saved as single pages via Applescript
      • From: Brian Christmas <email@hidden>
References: 
 >Can Acrobat PDF's be saved as single pages via Applescript (From: Brian Christmas <email@hidden>)

  • Prev by Date: Re: Can Acrobat PDF's be saved as single pages via Applescript
  • 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