mipmip
7/11/2013 - 12:39 PM

print Image Type And FilePath

print Image Type And FilePath

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