lib/openxml/docx/package.rb in openxml-docx-0.11.0.rc vs lib/openxml/docx/package.rb in openxml-docx-0.11.0
- old
+ new
@@ -8,10 +8,11 @@
:settings,
:headers,
:footers,
:styles,
:fonts,
+ :numbering,
:image_names
content_types do
default "xml", TYPE_XML
default "odttf", TYPE_OBSCURED_FONT
@@ -21,33 +22,37 @@
default "bmp", TYPE_IMAGE[:bmp]
default "tiff", TYPE_IMAGE[:tiff]
override "/word/styles.xml", TYPE_STYLES
override "/word/settings.xml", TYPE_SETTINGS
override "/word/fontTable.xml", TYPE_FONT_TABLE
+ override "/word/numbering.xml", TYPE_NUMBERING
end
def initialize
super
rels.add_relationship REL_DOCUMENT, "/word/document.xml"
@settings = OpenXml::Docx::Parts::Settings.new
@styles = OpenXml::Docx::Parts::Styles.new
@fonts = OpenXml::Docx::Parts::Fonts.new
+ @numbering = OpenXml::Docx::Parts::Numbering.new
@document = OpenXml::Docx::Parts::Document.new
@headers = []
@footers = []
@image_names = []
document.relationships.add_relationship REL_STYLES, "styles.xml"
document.relationships.add_relationship REL_SETTINGS, "settings.xml"
document.relationships.add_relationship REL_FONT_TABLE, "fontTable.xml"
+ document.relationships.add_relationship REL_NUMBERING, "numbering.xml"
add_part "word/_rels/document.xml.rels", document.relationships
add_part "word/_rels/fontTable.xml.rels", fonts.relationships
add_part "word/document.xml", document
add_part "word/settings.xml", settings
add_part "word/styles.xml", styles
add_part "word/fontTable.xml", fonts
+ add_part "word/numbering.xml", numbering
end
def embed_truetype_font(path: nil, name: nil)
open(path, "rb") do |source_font|
obfuscation_data = obfuscate_font source_font