Automating Powerpoint with ruby 에 소개된 루비로 파워포인트 다루는 예제 소스를 살짝 수정해보았다.
require 'win32ole'ppt_file = ARGV[0]exp_file = ppt_file.sub(/\.ppt$/i, '')# open powerpointppt = WIN32OLE.new('Powerpoint.Application')# make sure it is visibleppt.Visible = true# open the presentation to be exportedpre = ppt.Presentations.Open(ppt_file)# export the file(1..pre.Slides.count).each do |i|pre.Slides(i).Export("#{exp_file}_#{i}.png", "png")end# close powerpoint, will close all the currently open filesppt.Quit()
Ruby + Powerpoint 관련해서는 아래 블로그도 볼만하다.
댓글 없음:
댓글 쓰기