Created
July 11, 2013 12:39
-
-
Save mipmip/5975098 to your computer and use it in GitHub Desktop.
print Image Type And FilePath
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
require 'rubygems' | |
require 'appscript' | |
include Appscript | |
outputDir= File.join(ENV['HOME'],'Desktop') | |
pdfpath = File.join(outputDir, "myTempFile.pdf") | |
filepath = File.join(outputDir, "myTempFile.indd") | |
imagepath = File.join(outputDir, "Schermafbeelding.png") | |
imagepath = File.join(outputDir, "Schermafbeelding.png") | |
imagepath = File.join(outputDir, "test.psd") | |
idApp = app('Adobe InDesign CS4') | |
myDoc= idApp.make(:new => :document) | |
myFrame = idApp.documents[1].pages[1].make(:new => :rectangle) | |
myFrame.geometric_bounds.set(['6p', '6p', '18p', '18p']) | |
#myFrame.frame_fitting_option.fitting_alignment.set(:to => :bottom_center_anchor) | |
#myFrame.place(MacTypes::FileURL.path(imagepath).hfs_path) | |
#p myFrame.graphics.class_.get | |
#p myFrame.graphics.item_link.name.get.length | |
p idApp.documents[1].all_graphics.get | |
p idApp.PDF_export_preferences.acrobat_compatibility.get | |
idApp.PDF_export_preferences.acrobat_compatibility.set(:to => :acrobat_8) | |
idApp.export(myDoc, :format => :PDF_type, :to => MacTypes::FileURL.path(pdfpath).hfs_path, :timeout => 0, :showing_options => false, :using => '[Smallest File Size]') | |
p `pdfinfo #{pdfpath}` | |
# | |
#p File.extname(idapp.documents[1].all_graphics.item_link.name.get) | |
#idApp.documents[1].all_graphics.item_link.name.get | |
#p myFrame.graphics |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment