Created
April 23, 2014 09:17
-
-
Save skyriser/11208296 to your computer and use it in GitHub Desktop.
Print Presentation Title of Powerpoint (after 2007)
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 'rubyzip.gem' | |
require 'zip/zip' | |
tmp_file_path = '/path/to/great_presentation.pptx' | |
Zip::ZipFile.open(tmp_file_path) do |zip| | |
zip.each do |f| | |
next unless f.name =~ /\AdocProps\/core\.xml\Z/ | |
doc = ::REXML::Document.new(zip.read(f.name)) | |
title = doc.elements["cp:coreProperties/dc:title"].text | |
puts title | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
プレゼンテーションのスライドのタイトルとかを取りたい場合は、
を利用させてもらうと快適。