Skip to content

Commit

Permalink
Merge pull request #1 from Jawad79Ahmad/header-footer
Browse files Browse the repository at this point in the history
ability to extract headers and footers
  • Loading branch information
Jawad79Ahmad authored Jul 26, 2024
2 parents c5bcb57 + c508af2 commit a560503
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/docx/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@ def bookmarks
bkmrks_hsh
end

def headers
@zip.glob('word/header*.xml').map do |entry|
header_xml = entry.get_input_stream.read
Nokogiri::XML(header_xml)
end
end

def footers
@zip.glob('word/footer*.xml').map do |entry|
footer_xml = entry.get_input_stream.read
Nokogiri::XML(footer_xml)
end
end

def to_xml
Nokogiri::XML(@document_xml)
end
Expand Down

0 comments on commit a560503

Please sign in to comment.