Skip to content

Instantly share code, notes, and snippets.

@skyriser
Created April 23, 2014 09:17
Show Gist options
  • Save skyriser/11208296 to your computer and use it in GitHub Desktop.
Save skyriser/11208296 to your computer and use it in GitHub Desktop.
Print Presentation Title of Powerpoint (after 2007)
# 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
@skyriser
Copy link
Author

プレゼンテーションのスライドのタイトルとかを取りたい場合は、

を利用させてもらうと快適。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment