Created
March 8, 2010 07:51
-
-
Save anandkunal/324979 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
total_pages = 68; | |
full_document_path = "~/Project/Assets/catalog.pdf"; | |
full_output_path = "~/Project/Assets/jpg/"; | |
function open_document(page) { | |
FileReference = new File(full_document_path); | |
PDFOpenOptions = new PDFOpenOptions(); | |
PDFOpenOptions.page = page; | |
PDFOpenOptions.resolution = 72; | |
app.open(FileReference, PDFOpenOptions); | |
} | |
function save_document(page) { | |
jpgFile = new File(full_output_path + page + ".jpeg"); | |
jpgSaveOptions = new JPEGSaveOptions(); | |
jpgSaveOptions.embedColorProfile = true; | |
jpgSaveOptions.quality = 12; | |
app.activeDocument.saveAs(jpgFile, jpgSaveOptions, true, Extension.LOWERCASE); | |
} | |
function close_document() { | |
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES); | |
} | |
for (i=1; i<=total_pages; i++) { | |
open_document(i); | |
save_document(i); | |
close_document(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment