require 'zip/filesystem'
require 'fileutils'
module Powerpoint
module Slide
class Powerpoint::Slide::Pictorial
def initialize extract_path, title, image_path, slide_number, coords={}
image_name = File.basename(image_path)
FileUtils.copy_file(image_path, "#{extract_path}/ppt/media/#{image_name}")
coords_tag = (coords.empty?) ? '' : '
'
rel_xml = '
'
rel_path = "#{extract_path}/ppt/slides/_rels/slide#{slide_number}.xml.rels"
File.open(rel_path, 'w'){ |f| f << rel_xml }
slide_xml = '
' + title + '
' + coords_tag +
'
'
slide_path = "#{extract_path}/ppt/slides/slide#{slide_number}.xml"
File.open(slide_path, 'w'){ |f| f << slide_xml }
end
end
end
end