class OoxmlParser::Presentation
Basic class for all parsed pptx data
Attributes
@return [PresentationComments] comments of presentation
@return [Relationships] relationships of presentation
@return [Array<SlideLayout>] list of slide layouts
@return [Array<SlideMasterFile>] list of slide master
@return [TableStyles] table styles data
Public Class Methods
Source
# File lib/ooxml_parser/pptx_parser/presentation.rb, line 34 def initialize(params = {}) @slides = [] @comments = [] @slide_masters = [] @slide_layouts = [] super end
Calls superclass method
OoxmlParser::CommonDocumentStructure::new
Public Instance Methods
Source
# File lib/ooxml_parser/pptx_parser/presentation.rb, line 44 def parse @content_types = ContentTypes.new(parent: self).parse @root_subfolder = 'ppt/' root_object.add_to_xmls_stack('ppt/presentation.xml') doc = parse_xml(root_object.current_xml) @theme = PresentationTheme.new(parent: self).parse('ppt/theme/theme1.xml') @table_styles = TableStyles.new(parent: self).parse @comment_authors = CommentAuthors.new(parent: self).parse @comments = PresentationComments.new(parent: self).parse presentation_node = doc.search('//p:presentation').first presentation_node.xpath('*').each do |presentation_node_child| case presentation_node_child.name when 'sldSz' @slide_size = SlideSize.new(parent: self).parse(presentation_node_child) when 'sldIdLst' presentation_node_child.xpath('p:sldId').each do |silde_id_node| slide_id = silde_id_node.attr('r:id') @slides << Slide.new(parent: self, xml_path: "#{root_object.root_subfolder}/#{root_object.get_link_from_rels(slide_id)}") .parse end end end root_object.xmls_stack.pop @relationships = Relationships.new(parent: self).parse_file("#{root_object.unpacked_folder}/ppt/_rels/presentation.xml.rels") parse_slide_layouts parse_slide_masters self end
Parse data of presentation @return [Presentation] parsed presentation