PostScript

Adobe Illustrator File Format Specification (AI7FileFormat.pdf)



ダウンロード:ai7fileformat.pdf


|

PostScript Language Document Structuring Conventions Specification(5001.DSC_Spec.pdf)

ダウンロード - 5001.dsc_spec.pdf

|

Encapsulated PostScript File Format Specification(5002.EPSF_Spec.pdf)


ダウンロード - 5002.epsf_spec.pdf

|

Encapsulated PostScript File Format Specification.pdf

ダウンロード - encapsulated20postscript20file20format20specification.pdf


|

PostScript Language Document Structuring Conventions Specification.pdf

ダウンロード - postscript20language20document20structuring20conventions20specification.pdf


|

PostScript Language Reference Manual SECOND EDITION.pdf

ダウンロード - postscript20language20reference20manual20second20edition.pdf


|

PostScript Language Reference Manual third edition.pdf

ダウンロード - postscript20language20reference20manual20third20edition.pdf


|

[Distiller]Psファイルをオプション選んでPDFに変換


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use framework "Foundation"
use framework "AppKit"
use scripting additions
property refMe : a reference to current application

##ファイルパスの格納用のリスト
set ocidFilePathURLArray to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)
#ファイル収集のオプション(非表示無視)
set ocidOption to (refMe's NSDirectoryEnumerationSkipsHiddenFiles)
#収集するキー(パスと名前)
set ocidKeysArray to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)
ocidKeysArray's addObject:(refMe's NSURLPathKey)
ocidKeysArray's addObject:(refMe's NSURLNameKey)
######
#収集するパス
set listDirPath to {"Adobe/Adobe PDF/Settings", "Adobe/Adobe PDF/Extras"}
#ローカルドメインの収集
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSApplicationSupportDirectory) inDomains:(refMe's NSLocalDomainMask))
set ocidLocalAppSupDirPathURL to ocidURLsArray's firstObject()
#収集して
repeat with itemDirPath in listDirPath
  set ocidChkDirPathURL to (ocidLocalAppSupDirPathURL's URLByAppendingPathComponent:(itemDirPath) isDirectory:(true))
  set lisrResponse to (appFileManager's contentsOfDirectoryAtURL:(ocidChkDirPathURL) includingPropertiesForKeys:(ocidKeysArray) options:(ocidOption) |error|:(reference))
  if (item 2 of lisrResponse) = (missing value) then
    set ocidGetFilePathURLArray to (item 1 of lisrResponse)
  else if (item 2 of lisrResponse) ≠ (missing value) then
log (item 2 of lisrResponse)'s localizedDescription() as text
  end if
  ##リストに追加
(ocidFilePathURLArray's addObjectsFromArray:(ocidGetFilePathURLArray))
end repeat
######
#ユーザードメインの収集
set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSApplicationSupportDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidLocalAppSupDirPathURL to ocidURLsArray's firstObject()
#収集して
repeat with itemDirPath in listDirPath
  set ocidChkDirPathURL to (ocidLocalAppSupDirPathURL's URLByAppendingPathComponent:(itemDirPath) isDirectory:(true))
  set lisrResponse to (appFileManager's contentsOfDirectoryAtURL:(ocidChkDirPathURL) includingPropertiesForKeys:(ocidKeysArray) options:(ocidOption) |error|:(reference))
  if (item 2 of lisrResponse) = (missing value) then
    set ocidGetFilePathURLArray to (item 1 of lisrResponse)
  else if (item 2 of lisrResponse) ≠ (missing value) then
log (item 2 of lisrResponse)'s localizedDescription() as text
  end if
  ##リストに追加
(ocidFilePathURLArray's addObjectsFromArray:(ocidGetFilePathURLArray))
end repeat
######
##ファイル名とパスのレコードを作成
set ocidName2URLDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
repeat with itemFilePathURL in ocidFilePathURLArray
  set ocidFileName to itemFilePathURL's lastPathComponent()
(ocidName2URLDict's setObject:(itemFilePathURL) forKey:(ocidFileName))
end repeat
######
##ファイル名だけのリスト
set ocidAllKeys to ocidName2URLDict's allKeys()
##ソート
set ocidFileNameArray to ocidAllKeys's sortedArrayUsingSelector:("localizedStandardCompare:")
set listFileNameArray to ocidFileNameArray as list
#最小ファイルサイズが何番目か?
set numIndex to ocidFileNameArray's indexOfObject:("Smallest File Size.joboptions")
set numIndex to (numIndex + 1) as integer
##################
#ダイアログ
set strName to (name of current application) as text
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
###
set strTitle to ("選んでください") as text
set strPrompt to ("ジョブオプションを選んでください") as text
try
  set listResponse to (choose from list listFileNameArray with title strTitle with prompt strPrompt default items (item numIndex of listFileNameArray) OK button name "OK" cancel button name "キャンセル" without multiple selections allowed and empty selection allowed) as list
on error
log "エラーしました"
return "エラーしました"
end try
if (item 1 of listResponse) is false then
return "キャンセルしましたA"
else if (item 1 of listResponse) is "キャンセル" then
return "キャンセルしましたB"
else
  set strResponse to (item 1 of listResponse) as text
end if
##
set ocidChooseFilePathURL to ocidName2URLDict's objectForKey:(strResponse)
set strChooseFilePath to ocidChooseFilePathURL's |path| as text
set strAdobePDFSettingsPath to strChooseFilePath as text

###ダイアログ
set strName to (name of current application) as text
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDesktopDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidDesktopDirPathURL to ocidURLsArray's firstObject()
set aliasDefaultLocation to (ocidDesktopDirPathURL's absoluteURL()) as alias

set listUTI to {"com.adobe.postscript"}
set strMes to ("ファイルを選んでください") as text
set strPrompt to ("ファイルを選んでください") as text
try
  ### ファイル選択時
  set aliasFilePath to (choose file strMes with prompt strPrompt default location (aliasDefaultLocation) of type listUTI with invisibles and showing package contents without multiple selections allowed) as alias
on error
log "エラーしました"
return "エラーしました"
end try

set strPsFilePath to (POSIX path of aliasFilePath) as text
set ocidFilePathStr to refMe's NSString's stringWithString:(strPsFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set ocidFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:false)
set ocidContainerDirPathURL to ocidFilePathURL's URLByDeletingLastPathComponent()
set strDestinationPath to ocidContainerDirPathURL's |path| as text


tell application "Acrobat Distiller" to launch
##起動待ち最大10秒
repeat 20 times
  tell application id "com.adobe.distiller"
    set boolFrontmost to frontmost as boolean
  end tell
  if boolFrontmost is false then
    tell application id "com.adobe.distiller"
activate
    end tell
delay 0.5
  else if boolFrontmost is true then
    exit repeat
  end if
end repeat

tell application "Acrobat Distiller"
Distill sourcePath strPsFilePath destinationPath strDestinationPath adobePDFSettingsPath strAdobePDFSettingsPath
end tell

tell application "Acrobat Distiller"
quit
end tell

|

[macOS14]Postscript・eps(encapsulated-postscript)ファイルのPDF変換


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
(*
Inkscapeのインストールが必須になります
https://inkscape.org/release/1.3/mac-os-x/
Inkscape内臓の
Ghostscriptを利用してPSとEPSをPDFに変換します
*)
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application

set strBundleID to "org.inkscape.Inkscape" as text
################################
###ダイアログ 変換するファイル
set strName to (name of current application) as text
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDesktopDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidDesktopDirPathURL to ocidURLsArray's firstObject()
set aliasDefaultLocation to (ocidDesktopDirPathURL's absoluteURL()) as alias
set listUTI to {"com.adobe.encapsulated-postscript", "com.adobe.postscript"}
set strMes to ("ファイルを選んでください") as text
set strPrompt to ("ファイルを選んでください") as text
try
  set listAliasFilePath to (choose file strMes with prompt strPrompt default location aliasDefaultLocation of type listUTI with invisibles, multiple selections allowed and showing package contents) as list
on error
  log "エラーしました"
return "エラーしました"
end try
if listAliasFilePath is {} then
return "選んでください"
end if



################################
###ダイアログ 変換PDFバージョン
set listPdfVer to {"ps2pdf", "ps2pdf12", "ps2pdf13", "ps2pdf14"}
###ダイアログ
set strName to (name of current application) as text
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
try
  set listResponse to (choose from list listPdfVer with title "短め" with prompt "長め" default items (item 1 of listPdfVer) OK button name "OK" cancel button name "キャンセル" without multiple selections allowed and empty selection allowed) as list
on error
  log "エラーしました"
return "エラーしました"
end try
if (item 1 of listResponse) is false then
return "キャンセルしました"
else
  set strResponse to (item 1 of listResponse) as text
end if
################################
###バンドルIDからアプリケーションのインストール先を求める
set ocidAppBundle to refMe's NSBundle's bundleWithIdentifier:(strBundleID)
if ocidAppBundle is missing value then
  set appNSWorkspace to refMe's NSWorkspace's sharedWorkspace()
  set ocidAppBundlePathURL to (appNSWorkspace's URLForApplicationWithBundleIdentifier:(strBundleID))
else
  set ocidAppBundleStr to ocidAppBundle's bundlePath()
  set ocidAppBundlePath to ocidAppBundleStr's stringByStandardizingPath
  set ocidAppBundlePathURL to (refMe's NSURL's fileURLWithPath:(ocidAppBundlePath))
end if
if ocidAppBundlePathURL = (missing value) then
  tell application "Finder"
    try
      set aliasAppApth to (application file id strBundleID) as alias
    on error
return "アプリケーションが見つかりませんでした"
    end try
  end tell
  set strAppPath to POSIX path of aliasAppApth as text
  set ocidAppBundlePathStr to refMe's NSString's stringWithString:(strAppPath)
  set ocidAppBundlePath to ocidAppBundlePathStr's stringByStandardizingPath()
  set ocidAppBundlePathURL to refMe's NSURL's alloc()'s initFileURLWithPath:(ocidAppBundlePath) isDirectory:true
end if
###コマンドのあるディレクトリ
set ocidBinDirPathURL to ocidAppBundlePathURL's URLByAppendingPathComponent:("Contents/Resources/bin/")
###ダイアログの戻り値を加えてバイナリへのパス
set ocidBinPathURL to ocidBinDirPathURL's URLByAppendingPathComponent:(strResponse)
set strBinPath to ocidBinPathURL's |path| as text
log strBinPath
################################
###本処理
repeat with itemAliasFilePath in listAliasFilePath
  ###パス
  set strFilePath to (POSIX path of itemAliasFilePath) as text
  set ocidFilePathStr to (refMe's NSString's stringWithString:(strFilePath))
  set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
  set ocidFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:false)
  ##コンテナ
  set ocidContainerDirPathURL to ocidFilePathURL's URLByDeletingLastPathComponent()
  set ocidBaseFilePathURL to ocidFilePathURL's URLByDeletingPathExtension()
  set ocidFileName to ocidBaseFilePathURL's lastPathComponent()
  set ocidSaveFileName to (ocidFileName's stringByAppendingPathExtension:("pdf"))
  set ocidSaveFilePathURL to (ocidContainerDirPathURL's URLByAppendingPathComponent:(ocidSaveFileName))
  set strSaveFilePath to ocidSaveFilePathURL's |path| as text
  ###コマンド整形
  set strCommandText to ("\"" & strBinPath & "\" \"" & strFilePath & "\" \"" & strSaveFilePath & "\"") as text
  ##実行はターミナルで(エラーメッセージ出るからね)
  tell application "Terminal"
    launch
    activate
    set objWindowID to (do script "\n\n")
    delay 1
do script strCommandText in objWindowID
    delay 2
do script "\n\n" in objWindowID
    # do script "exit" in objWindowID
    # set theWid to get the id of window 1
    # delay 1
    # close front window saving no
  end tell
  
end repeat


|

EPSファイルをPDFに変換する



「pstopdf」ユーティリティは、macOS 14 Sonomaで廃止されました


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application


#######
###
(* pstopdfは
初回実行時に時間がかかる事から
事前に起動時に削除される形式で実行しておく
*)
set strInputPath to ("/System/Library/Frameworks/Tk.framework/Versions/8.5/Resources/Scripts/images/logo.eps") as text
set strOutPutPath to ("/tmp/logo.eps.pdf") as text
####コマンドパス
set strBinPath to "/usr/bin/pstopdf"
#####コマンド整形
set strCommandText to ("\"" & strBinPath & "\"  \"" & strInputPath & "\" -o \"" & strOutPutPath & "\"") as text
do shell script strCommandText

#############################
#####ファイル選択ダイアログ
#############################
###ダイアログを前面に出す
tell current application
  set strName to name as text
end tell
####スクリプトメニューから実行したら
if strName is "osascript" then
  tell application "Finder"
    activate
  end tell
else
  tell current application
    activate
  end tell
end if
###ダイアログのデフォルト
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidUserDesktopPath to (appFileManager's URLsForDirectory:(refMe's NSDesktopDirectory) inDomains:(refMe's NSUserDomainMask))
set aliasDefaultLocation to ocidUserDesktopPath as alias
set listChooseFileUTI to {"com.adobe.encapsulated-postscript", "com.adobe.postscript"}
set strPromptText to "ファイルを選んでください" as text
set listAliasFilePath to (choose file with prompt strPromptText default location (aliasDefaultLocation) of type listChooseFileUTI with invisibles and multiple selections allowed without showing package contents) as list

############
set strMes to "保存先フォルダを選んでください" as text
set strPrompt to "保存先フォルダを選択してください" as text
try
  set aliasSaveDirPath to (choose folder strMes with prompt strPrompt default location aliasDefaultLocation without multiple selections allowed, invisibles and showing package contents) as alias
on error
  log "エラーしました"
return "エラーしました"
end try
set strSaveDirPath to (POSIX path of aliasSaveDirPath) as text
set ocidSaveDirPathStr to (refMe's NSString's stringWithString:(strSaveDirPath))
set ocidSaveDirPathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidSaveDirPathStr))

####複数ファイル対応
repeat with itemAliasFilePath in listAliasFilePath
  ###エイリアス
  set aliasFilePath to itemAliasFilePath as alias
  ###パステキスト
  set strFilePath to (POSIX path of aliasFilePath) as text
  ####入力ファイルパス確定
  set strInputFilePath to strFilePath as text
  ###パス
  set ocidFilePath to (refMe's NSString's stringWithString:(strFilePath))
  ###NSURL
  set ocidFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath))
  ###ファイル名
  set ocidFileName to ocidFilePathURL's lastPathComponent()
  ###拡張子を取ったベースファイル名
  set strBaseFileName to ocidFileName's stringByDeletingPathExtension() as text
  ####出力ファイル名
  set strNewFileName to (strBaseFileName & ".pdf") as text
  ####ディレクトリのURL
  set ocidSaveFilePathURL to (ocidSaveDirPathURL's URLByAppendingPathComponent:(strNewFileName))
  ####ファイルの有無チェック
  set boolFileExist to (ocidSaveFilePathURL's checkResourceIsReachableAndReturnError:(missing value)) as boolean
  ###すでに同名ファイルがある場合は日付時間入りのファイル名
  if boolFileExist is true then
    ####日付情報の取得
    set ocidDate to refMe's NSDate's |date|()
    ###日付のフォーマットを定義
    set ocidNSDateFormatter to refMe's NSDateFormatter's alloc()'s init()
(ocidNSDateFormatter's setDateFormat:"yyyyMMddhhmm")
    set ocidDateAndTime to (ocidNSDateFormatter's stringFromDate:(ocidDate))
    set strDateAndTime to ocidDateAndTime as text
    ####ファイル名に日付を入れる
    set strSaveFileName to (strBaseFileName & "." & strDateAndTime & ".pdf") as text
    set ocidSaveFilePathURL to (ocidSaveDirPathURL's URLByAppendingPathComponent:(strSaveFileName))
      set strSaveFilePath to (ocidSaveFilePathURL's |path|()) as text
  else
    ####出力ファイルパス
    set strSaveFilePath to (ocidSaveFilePathURL's |path|()) as text
  end if
  ################################################
  ####コマンドパス
  set strBinPath to "/usr/bin/pstopdf"
  #####コマンド整形
  set strCommandText to ("\"" & strBinPath & "\"  \"" & strInputFilePath & "\" -o \"" & strSaveFilePath & "\"") as text
  do shell script strCommandText
  (* ターミナル使いたい場合はこちら
####ターミナルで開く
tell application "Terminal"
launch
activate
set objWindowID to (do script "\n\n")
delay 1
do script strCommandText in objWindowID
end tell
*)
end repeat




|

その他のカテゴリー

Accessibility Acrobat Acrobat 2020 Acrobat 2024 Acrobat AddOn Acrobat Annotation Acrobat AppleScript Acrobat ARMDC Acrobat AV2 Acrobat BookMark Acrobat Classic Acrobat DC Acrobat Dialog Acrobat Distiller Acrobat Form Acrobat GentechAI Acrobat JS Acrobat JS Word Search Acrobat Maintenance Acrobat Manifest Acrobat Menu Acrobat Merge Acrobat Open Acrobat PDFPage Acrobat Plugin Acrobat Preferences Acrobat Preflight Acrobat Print Acrobat Python Acrobat Reader Acrobat Reader Localized Acrobat Reference Acrobat Registered Products Acrobat SCA Acrobat SCA Updater Acrobat Sequ Acrobat Sign Acrobat Stamps Acrobat URL List Mac Acrobat URL List Windows Acrobat Watermark Acrobat Windows Acrobat Windows Reader Admin Admin Account Admin Apachectl Admin ConfigCode Admin configCode Admin Device Management Admin LaunchServices Admin Locationd Admin loginitem Admin Maintenance Admin Mobileconfig Admin NetWork Admin Permission Admin Pkg Admin Power Management Admin Printer Admin Printer Basic Admin Printer Custompapers Admin SetUp Admin SMB Admin softwareupdate Admin Support Admin System Information Admin TCC Admin Tools Admin Umask Admin Users Admin Volumes Admin XProtect Adobe Adobe AUSST Adobe Bridge Adobe Documents Adobe FDKO Adobe Fonts Adobe Reference Adobe RemoteUpdateManager Adobe Sap Code AppKit Apple AppleScript AppleScript Duplicate AppleScript entire contents AppleScript List AppleScript ObjC AppleScript Osax AppleScript PDF AppleScript Pictures AppleScript record AppleScript Video Applications AppStore Archive Archive Keka Attributes Automator BackUp Barcode Barcode Decode Barcode QR Bash Basic Basic Path Bluetooth BOX Browser Calendar CD/DVD Choose Chrome Chromedriver CIImage CityCode CloudStorage Color Color NSColor Color NSColorList com.apple.LaunchServices.OpenWith Console Contacts CotEditor CURL current application Date&Time delimiters Desktop Desktop Position Device Diff Disk do shell script Dock Dock Launchpad DropBox Droplet eMail Encode % Encode Decode Encode HTML Entity Encode UTF8 Error EXIFData exiftool ffmpeg File File Name Finder Finder Window Firefox Folder FolderAction Font List FontCollections Fonts Fonts Asset_Font Fonts ATS Fonts Emoji Fonts Maintenance Fonts Morisawa Fonts Python Fonts Variable Foxit GIF github Guide HTML Icon Icon Assets.car Illustrator Image Events ImageOptim Input Dictionary iPhone iWork Javascript Jedit Ω Json Label Language Link locationd lsappinfo m3u8 Mail Map Math Media Media AVAsset Media AVconvert Media AVFoundation Media AVURLAsset Media Movie Media Music Memo Messages Microsoft Microsoft Edge Microsoft Excel Microsoft Fonts Microsoft Office Microsoft Office Link Microsoft OneDrive Microsoft Teams Mouse Music Node Notes NSArray NSArray Sort NSAttributedString NSBezierPath NSBitmapImageRep NSBundle NSCFBoolean NSCharacterSet NSData NSDecimalNumber NSDictionary NSError NSEvent NSFileAttributes NSFileManager NSFileManager enumeratorAtURL NSFont NSFontManager NSGraphicsContext NSGraphicsContext Crop NSImage NSIndex NSKeyedArchiver NSKeyedUnarchiver NSLocale NSMetadataItem NSMutableArray NSMutableDictionary NSMutableString NSNotFound NSNumber NSOpenPanel NSPasteboard NSpoint NSPredicate NSRange NSRect NSRegularExpression NSRunningApplication NSScreen NSSet NSSize NSString NSString stringByApplyingTransform NSStringCompareOptions NSTask NSTimeZone NSUbiquitous NSURL NSURL File NSURLBookmark NSURLComponents NSURLResourceKey NSURLSession NSUserDefaults NSUUID NSView NSWorkspace Numbers OAuth PDF PDF Image2PDF PDF MakePDF PDF nUP PDF Pymupdf PDF Pypdf PDFContext PDFDisplayBox PDFImageRep PDFKit PDFKit Annotation PDFKit AnnotationWidget PDFKit DocumentPermissions PDFKit OCR PDFKit Outline PDFKit Start PDFPage PDFPage Rotation PDFView perl Photoshop PlistBuddy pluginkit plutil postalcode PostScript PowerShell prefPane Preview Python Python eyed3 Python pip QuickLook QuickTime ReadMe Regular Expression Reminders ReName Repeat RTF Safari SaveFile ScreenCapture ScreenSaver Script Editor Script Menu SF Symbols character id SF Symbols Entity Shortcuts Shortcuts Events sips Skype Slack Sound Spotlight sqlite StandardAdditions StationSearch Subtitles LRC Subtitles SRT Subtitles VTT Swift swiftDialog System Events System Settings TemporaryItems Terminal Text Text CSV Text MD Text TSV TextEdit Tools Translate Trash Twitter Typography UI Unit Conversion UTType valueForKeyPath Video VisionKit Visual Studio Code VMware Fusion Wacom Weather webarchive webp Wifi Windows XML XML EPUB XML HTML XML LSSharedFileList XML LSSharedFileList sfl2 XML LSSharedFileList sfl3 XML objectsForXQuery XML OPML XML Plist XML Plist System Events XML RSS XML savedSearch XML SVG XML TTML XML webloc XML xmllint XML XMP YouTube Zero Padding zoom