diff --git a/docx-core/src/documents/elements/bookmark_end.rs b/docx-core/src/documents/elements/bookmark_end.rs index b62f395..44f6ee5 100644 --- a/docx-core/src/documents/elements/bookmark_end.rs +++ b/docx-core/src/documents/elements/bookmark_end.rs @@ -5,7 +5,7 @@ use crate::xml_builder::*; #[derive(Serialize, Debug, Clone, PartialEq)] pub struct BookmarkEnd { - id: usize, + pub id: usize, } impl BookmarkEnd { diff --git a/docx-core/src/documents/elements/bookmark_start.rs b/docx-core/src/documents/elements/bookmark_start.rs index 3b9d6d7..41e1a35 100644 --- a/docx-core/src/documents/elements/bookmark_start.rs +++ b/docx-core/src/documents/elements/bookmark_start.rs @@ -5,8 +5,8 @@ use crate::xml_builder::*; #[derive(Serialize, Debug, Clone, PartialEq)] pub struct BookmarkStart { - id: usize, - name: String, + pub id: usize, + pub name: String, } impl BookmarkStart { diff --git a/docx-core/src/documents/elements/doc_id.rs b/docx-core/src/documents/elements/doc_id.rs index 60b3ac0..7022dfb 100644 --- a/docx-core/src/documents/elements/doc_id.rs +++ b/docx-core/src/documents/elements/doc_id.rs @@ -1,9 +1,9 @@ -use serde::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize, Serializer}; use crate::documents::BuildXML; use crate::xml_builder::*; -#[derive(Debug, Clone, Deserialize, PartialEq, Serialize)] +#[derive(Debug, Clone, Deserialize, PartialEq)] pub struct DocId { id: String, } @@ -14,6 +14,15 @@ impl DocId { } } +impl Serialize for DocId { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_str(&self.id) + } +} + impl BuildXML for DocId { fn build(&self) -> Vec { let b = XMLBuilder::new(); diff --git a/docx-core/src/documents/mod.rs b/docx-core/src/documents/mod.rs index b56ecee..166cd5f 100644 --- a/docx-core/src/documents/mod.rs +++ b/docx-core/src/documents/mod.rs @@ -129,6 +129,11 @@ impl Docx { self } + pub fn settings(mut self, s: Settings) -> Self { + self.settings = s; + self + } + pub fn add_paragraph(mut self, p: Paragraph) -> Docx { if p.has_numbering { // If this document has numbering, set numberings.xml to document_rels. diff --git a/docx-core/src/reader/bookmark_end.rs b/docx-core/src/reader/bookmark_end.rs new file mode 100644 index 0000000..5c204ee --- /dev/null +++ b/docx-core/src/reader/bookmark_end.rs @@ -0,0 +1,27 @@ +use std::io::Read; +use std::str::FromStr; + +use xml::attribute::OwnedAttribute; +use xml::reader::EventReader; + +use super::*; + +impl ElementReader for BookmarkEnd { + fn read( + _r: &mut EventReader, + attrs: &[OwnedAttribute], + ) -> Result { + let mut id: Option = None; + for a in attrs { + let local_name = &a.name.local_name; + if local_name == "id" { + id = Some(usize::from_str(&a.value)?); + } + } + if let Some(id) = id { + Ok(BookmarkEnd::new(id)) + } else { + Err(ReaderError::XMLReadError) + } + } +} diff --git a/docx-core/src/reader/bookmark_start.rs b/docx-core/src/reader/bookmark_start.rs new file mode 100644 index 0000000..630e1a3 --- /dev/null +++ b/docx-core/src/reader/bookmark_start.rs @@ -0,0 +1,30 @@ +use std::io::Read; +use std::str::FromStr; + +use xml::attribute::OwnedAttribute; +use xml::reader::EventReader; + +use super::*; + +impl ElementReader for BookmarkStart { + fn read( + _r: &mut EventReader, + attrs: &[OwnedAttribute], + ) -> Result { + let mut id: Option = None; + let mut name: Option = None; + + for a in attrs { + let local_name = &a.name.local_name; + if local_name == "id" { + id = Some(usize::from_str(&a.value)?); + } else if local_name == "name" { + name = Some(a.value.clone()); + } + } + if id.is_none() || name.is_none() { + return Err(ReaderError::XMLReadError); + } + Ok(BookmarkStart::new(id.unwrap(), name.unwrap())) + } +} diff --git a/docx-core/src/reader/document.rs b/docx-core/src/reader/document.rs index be1a086..cc50f36 100644 --- a/docx-core/src/reader/document.rs +++ b/docx-core/src/reader/document.rs @@ -28,6 +28,16 @@ impl FromXML for Document { doc = doc.add_table(t); continue; } + XMLElement::BookmarkStart => { + let s = BookmarkStart::read(&mut parser, &attributes)?; + doc = doc.add_bookmark_start(s.id, s.name); + continue; + } + XMLElement::BookmarkEnd => { + let e = BookmarkEnd::read(&mut parser, &attributes)?; + doc = doc.add_bookmark_end(e.id); + continue; + } _ => {} } } diff --git a/docx-core/src/reader/mod.rs b/docx-core/src/reader/mod.rs index 52e0961..21a1bdf 100644 --- a/docx-core/src/reader/mod.rs +++ b/docx-core/src/reader/mod.rs @@ -1,6 +1,8 @@ mod a_graphic; mod a_graphic_data; mod attributes; +mod bookmark_end; +mod bookmark_start; mod delete; mod document; mod document_rels; @@ -19,6 +21,7 @@ mod read_zip; mod rels; mod run; mod run_property; +mod settings; mod style; mod styles; mod table; @@ -49,6 +52,8 @@ const STYLE_RELATIONSHIP_TYPE: &str = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"; const NUMBERING_RELATIONSHIP_TYPE: &str = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering"; +const SETTINGS_TYPE: &str = + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings"; pub fn read_docx(buf: &[u8]) -> Result { let cur = Cursor::new(buf); @@ -101,5 +106,16 @@ pub fn read_docx(buf: &[u8]) -> Result { docx = docx.numberings(nums); } + // Read settings + let settings_path = rels.find_target_path(SETTINGS_TYPE); + if let Some(settings_path) = settings_path { + let data = read_zip( + &mut archive, + settings_path.to_str().expect("should have settings"), + )?; + let settings = Settings::from_xml(&data[..])?; + docx = docx.settings(settings); + } + Ok(docx) } diff --git a/docx-core/src/reader/paragraph.rs b/docx-core/src/reader/paragraph.rs index 1f60ff6..7b472b4 100644 --- a/docx-core/src/reader/paragraph.rs +++ b/docx-core/src/reader/paragraph.rs @@ -42,36 +42,13 @@ impl ElementReader for Paragraph { continue; } XMLElement::BookmarkStart => { - let mut id: Option = None; - let mut name: Option = None; - - for a in attributes { - let local_name = &a.name.local_name; - if local_name == "id" { - id = Some(usize::from_str(&a.value)?); - } else if local_name == "name" { - name = Some(a.value.clone()); - } - } - if id.is_none() || name.is_none() { - return Err(ReaderError::XMLReadError); - } - p = p.add_bookmark_start(id.unwrap(), name.unwrap()); + let s = BookmarkStart::read(r, &attributes)?; + p = p.add_bookmark_start(s.id, s.name); continue; } XMLElement::BookmarkEnd => { - let mut id: Option = None; - for a in attributes { - let local_name = &a.name.local_name; - if local_name == "id" { - id = Some(usize::from_str(&a.value)?); - } - } - if let Some(id) = id { - p = p.add_bookmark_end(id); - } else { - return Err(ReaderError::XMLReadError); - } + let e = BookmarkEnd::read(r, &attributes)?; + p = p.add_bookmark_end(e.id); continue; } XMLElement::CommentRangeStart => { diff --git a/docx-core/src/reader/settings.rs b/docx-core/src/reader/settings.rs new file mode 100644 index 0000000..32bda70 --- /dev/null +++ b/docx-core/src/reader/settings.rs @@ -0,0 +1,48 @@ +use std::io::Read; +use xml::reader::{EventReader, XmlEvent}; + +use super::*; +use crate::reader::{FromXML, ReaderError}; + +use std::str::FromStr; + +impl FromXML for Settings { + fn from_xml(reader: R) -> Result { + let mut parser = EventReader::new(reader); + let mut settings = Self::default(); + + loop { + let e = parser.next(); + match e { + Ok(XmlEvent::StartElement { + attributes, name, .. + }) => { + let e = XMLElement::from_str(&name.local_name).unwrap(); + if let XMLElement::DocId = e { + for a in attributes { + if let Some(prefix) = a.name.prefix { + let local_name = &a.name.local_name; + // Ignore w14:val + if local_name == "val" && prefix == "w15" { + settings = settings.doc_id( + &a.value.to_owned().replace("{", "").replace("}", ""), + ); + } + } + } + } + } + Ok(XmlEvent::EndElement { name, .. }) => { + let e = XMLElement::from_str(&name.local_name).unwrap(); + if let XMLElement::Settings = e { + break; + } + } + Ok(XmlEvent::EndDocument { .. }) => break, + Err(_) => return Err(ReaderError::XMLReadError), + _ => {} + } + } + Ok(settings) + } +} diff --git a/docx-core/src/reader/xml_element.rs b/docx-core/src/reader/xml_element.rs index 2a67c30..ff7945f 100644 --- a/docx-core/src/reader/xml_element.rs +++ b/docx-core/src/reader/xml_element.rs @@ -83,6 +83,7 @@ pub enum XMLElement { StartOverride, Level, Numbering, + Settings, Num, Start, NumberFormat, @@ -94,6 +95,7 @@ pub enum XMLElement { Drawing, TxbxContent, Pict, + DocId, Unsupported, } @@ -226,6 +228,7 @@ impl FromStr for XMLElement { "abstractNumId" => Ok(XMLElement::AbstractNumberingId), "lvl" => Ok(XMLElement::Level), "numbering" => Ok(XMLElement::Numbering), + "settings" => Ok(XMLElement::Settings), "num" => Ok(XMLElement::Num), "start" => Ok(XMLElement::Start), "numFmt" => Ok(XMLElement::NumberFormat), @@ -240,6 +243,7 @@ impl FromStr for XMLElement { "pict" => Ok(XMLElement::Pict), "lvlOverride" => Ok(XMLElement::LvlOverride), "startOverride" => Ok(XMLElement::StartOverride), + "docId" => Ok(XMLElement::DocId), _ => Ok(XMLElement::Unsupported), } } diff --git a/docx-core/tests/snapshots/lib__reader__read_bom.snap b/docx-core/tests/snapshots/lib__reader__read_bom.snap index ec58821..386351d 100644 --- a/docx-core/tests/snapshots/lib__reader__read_bom.snap +++ b/docx-core/tests/snapshots/lib__reader__read_bom.snap @@ -2,4 +2,4 @@ source: docx-core/tests/reader.rs expression: "&json" --- -"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/commentsExtended.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/header1.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false,\n \"imageIds\": []\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": \"both\",\n \"indent\": null\n }\n },\n {\n \"styleId\": \"DefaultParagraphFont\",\n \"name\": \"Default Paragraph Font\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"TableNormal\",\n \"name\": \"Normal Table\",\n \"styleType\": \"table\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"NoList\",\n \"name\": \"No List\",\n \"styleType\": \"numbering\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"0000001f\",\n \"children\": [\n {\n \"type\": \"bookmarkStart\",\n \"data\": {\n \"id\": 0,\n \"name\": \"_GoBack\"\n }\n },\n {\n \"type\": \"bookmarkEnd\",\n \"data\": {\n \"id\": 0\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Hello\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360,\n \"headerReference\": {\n \"headerType\": \"default\",\n \"id\": \"rId4\"\n },\n \"sectionType\": null\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100,\n \"docId\": null\n },\n \"fontTable\": {},\n \"media\": [],\n \"header\": {\n \"children\": []\n },\n \"commentsExtended\": {\n \"children\": []\n }\n}" +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/commentsExtended.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/header1.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false,\n \"imageIds\": []\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": \"both\",\n \"indent\": null\n }\n },\n {\n \"styleId\": \"DefaultParagraphFont\",\n \"name\": \"Default Paragraph Font\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"TableNormal\",\n \"name\": \"Normal Table\",\n \"styleType\": \"table\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"NoList\",\n \"name\": \"No List\",\n \"styleType\": \"numbering\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"0000001f\",\n \"children\": [\n {\n \"type\": \"bookmarkStart\",\n \"data\": {\n \"id\": 0,\n \"name\": \"_GoBack\"\n }\n },\n {\n \"type\": \"bookmarkEnd\",\n \"data\": {\n \"id\": 0\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Hello\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360,\n \"headerReference\": {\n \"headerType\": \"default\",\n \"id\": \"rId4\"\n },\n \"sectionType\": null\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100,\n \"docId\": \"58f67304-63b1-4505-b4ba-0c1a55a3ad31\"\n },\n \"fontTable\": {},\n \"media\": [],\n \"header\": {\n \"children\": []\n },\n \"commentsExtended\": {\n \"children\": []\n }\n}" diff --git a/docx-core/tests/snapshots/lib__reader__read_indent_word_online.snap b/docx-core/tests/snapshots/lib__reader__read_indent_word_online.snap index afbc24f..c9a5152 100644 --- a/docx-core/tests/snapshots/lib__reader__read_indent_word_online.snap +++ b/docx-core/tests/snapshots/lib__reader__read_indent_word_online.snap @@ -2,4 +2,4 @@ source: docx-core/tests/reader.rs expression: "&json" --- -"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/commentsExtended.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/header1.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false,\n \"imageIds\": []\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": \"both\",\n \"indent\": null\n }\n },\n {\n \"styleId\": \"DefaultParagraphFont\",\n \"name\": \"Default Paragraph Font\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"TableNormal\",\n \"name\": \"Normal Table\",\n \"styleType\": \"table\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"NoList\",\n \"name\": \"No List\",\n \"styleType\": \"numbering\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000042\",\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 0,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000043\",\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 22,\n \"szCs\": 22,\n \"color\": \"222222\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 840,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"firstLine\",\n \"val\": 0\n }\n }\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000044\",\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 0,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000045\",\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 22,\n \"szCs\": 22,\n \"color\": \"222222\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 840,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"firstLine\",\n \"val\": 720\n }\n }\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000046\",\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 840,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"firstLine\",\n \"val\": 720\n }\n }\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000047\",\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000048\",\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 1560,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 720\n }\n }\n },\n \"hasNumbering\": false\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360,\n \"headerReference\": {\n \"headerType\": \"default\",\n \"id\": \"rId4\"\n },\n \"sectionType\": null\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100,\n \"docId\": null\n },\n \"fontTable\": {},\n \"media\": [],\n \"header\": {\n \"children\": []\n },\n \"commentsExtended\": {\n \"children\": []\n }\n}" +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/commentsExtended.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/header1.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false,\n \"imageIds\": []\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": \"both\",\n \"indent\": null\n }\n },\n {\n \"styleId\": \"DefaultParagraphFont\",\n \"name\": \"Default Paragraph Font\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"TableNormal\",\n \"name\": \"Normal Table\",\n \"styleType\": \"table\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"NoList\",\n \"name\": \"No List\",\n \"styleType\": \"numbering\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000042\",\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 0,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000043\",\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 22,\n \"szCs\": 22,\n \"color\": \"222222\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 840,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"firstLine\",\n \"val\": 0\n }\n }\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000044\",\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 0,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000045\",\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 22,\n \"szCs\": 22,\n \"color\": \"222222\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 840,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"firstLine\",\n \"val\": 720\n }\n }\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000046\",\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 840,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"firstLine\",\n \"val\": 720\n }\n }\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000047\",\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000048\",\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 1560,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 720\n }\n }\n },\n \"hasNumbering\": false\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360,\n \"headerReference\": {\n \"headerType\": \"default\",\n \"id\": \"rId4\"\n },\n \"sectionType\": null\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100,\n \"docId\": \"08a45a55-dfcc-4396-aedc-f7a5bfb7db65\"\n },\n \"fontTable\": {},\n \"media\": [],\n \"header\": {\n \"children\": []\n },\n \"commentsExtended\": {\n \"children\": []\n }\n}" diff --git a/docx-core/tests/snapshots/lib__reader__read_textbox.snap b/docx-core/tests/snapshots/lib__reader__read_textbox.snap index a67601e..a5c828b 100644 --- a/docx-core/tests/snapshots/lib__reader__read_textbox.snap +++ b/docx-core/tests/snapshots/lib__reader__read_textbox.snap @@ -2,4 +2,4 @@ source: docx-core/tests/reader.rs expression: "&json" --- -"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/commentsExtended.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/header1.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false,\n \"imageIds\": []\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"a\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": \"both\",\n \"indent\": null\n }\n },\n {\n \"styleId\": \"a0\",\n \"name\": \"Default Paragraph Font\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"a1\",\n \"name\": \"Normal Table\",\n \"styleType\": \"table\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"a2\",\n \"name\": \"No List\",\n \"styleType\": \"numbering\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"0000006c\",\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"drawing\",\n \"data\": {\n \"position_type\": {\n \"Inline\": {\n \"dist_t\": 0,\n \"dist_b\": 0,\n \"dist_l\": 0,\n \"dist_r\": 0\n }\n },\n \"position_h\": {\n \"Offset\": 0\n },\n \"position_v\": {\n \"Offset\": 0\n },\n \"data\": null,\n \"children\": [\n {\n \"type\": \"anchor\",\n \"data\": {\n \"children\": [\n {\n \"children\": [\n {\n \"dataType\": \"wpShape\",\n \"children\": [\n {\n \"type\": \"shape\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"textbox\",\n \"data\": {\n \"children\": [\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"0000006d\",\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"H\"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"ello\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false\n }\n }\n ],\n \"has_numbering\": false\n }\n ],\n \"hasNumbering\": false\n }\n }\n ]\n }\n }\n ]\n }\n ]\n }\n ]\n }\n }\n ]\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360,\n \"headerReference\": {\n \"headerType\": \"default\",\n \"id\": \"rId4\"\n },\n \"sectionType\": null\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100,\n \"docId\": null\n },\n \"fontTable\": {},\n \"media\": [],\n \"header\": {\n \"children\": []\n },\n \"commentsExtended\": {\n \"children\": []\n }\n}" +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/commentsExtended.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/header1.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false,\n \"imageIds\": []\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"a\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": \"both\",\n \"indent\": null\n }\n },\n {\n \"styleId\": \"a0\",\n \"name\": \"Default Paragraph Font\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"a1\",\n \"name\": \"Normal Table\",\n \"styleType\": \"table\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"a2\",\n \"name\": \"No List\",\n \"styleType\": \"numbering\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"0000006c\",\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"drawing\",\n \"data\": {\n \"position_type\": {\n \"Inline\": {\n \"dist_t\": 0,\n \"dist_b\": 0,\n \"dist_l\": 0,\n \"dist_r\": 0\n }\n },\n \"position_h\": {\n \"Offset\": 0\n },\n \"position_v\": {\n \"Offset\": 0\n },\n \"data\": null,\n \"children\": [\n {\n \"type\": \"anchor\",\n \"data\": {\n \"children\": [\n {\n \"children\": [\n {\n \"dataType\": \"wpShape\",\n \"children\": [\n {\n \"type\": \"shape\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"textbox\",\n \"data\": {\n \"children\": [\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"0000006d\",\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"H\"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"ello\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false\n }\n }\n ],\n \"has_numbering\": false\n }\n ],\n \"hasNumbering\": false\n }\n }\n ]\n }\n }\n ]\n }\n ]\n }\n ]\n }\n }\n ]\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360,\n \"headerReference\": {\n \"headerType\": \"default\",\n \"id\": \"rId4\"\n },\n \"sectionType\": null\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100,\n \"docId\": \"C11ED300-8EA6-3D41-8D67-5E5DE3410CF8\"\n },\n \"fontTable\": {},\n \"media\": [],\n \"header\": {\n \"children\": []\n },\n \"commentsExtended\": {\n \"children\": []\n }\n}" diff --git a/docx-core/tests/snapshots/reader__read_bom.snap b/docx-core/tests/snapshots/reader__read_bom.snap index a46c759..e3177ea 100644 --- a/docx-core/tests/snapshots/reader__read_bom.snap +++ b/docx-core/tests/snapshots/reader__read_bom.snap @@ -2,4 +2,4 @@ source: docx-core/tests/reader.rs expression: "&json" --- -"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/commentsExtended.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/header1.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false,\n \"imageIds\": []\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": \"both\",\n \"indent\": null\n }\n },\n {\n \"styleId\": \"DefaultParagraphFont\",\n \"name\": \"Default Paragraph Font\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"TableNormal\",\n \"name\": \"Normal Table\",\n \"styleType\": \"table\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"NoList\",\n \"name\": \"No List\",\n \"styleType\": \"numbering\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000001\",\n \"children\": [\n {\n \"type\": \"bookmarkStart\",\n \"data\": {\n \"id\": 0,\n \"name\": \"_GoBack\"\n }\n },\n {\n \"type\": \"bookmarkEnd\",\n \"data\": {\n \"id\": 0\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Hello\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360,\n \"headerReference\": {\n \"headerType\": \"default\",\n \"id\": \"rId4\"\n },\n \"sectionType\": null\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100,\n \"docId\": null\n },\n \"fontTable\": {},\n \"media\": [],\n \"header\": {\n \"children\": []\n },\n \"commentsExtended\": {\n \"children\": []\n }\n}" +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/commentsExtended.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/header1.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false,\n \"imageIds\": []\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": \"both\",\n \"indent\": null\n }\n },\n {\n \"styleId\": \"DefaultParagraphFont\",\n \"name\": \"Default Paragraph Font\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"TableNormal\",\n \"name\": \"Normal Table\",\n \"styleType\": \"table\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"NoList\",\n \"name\": \"No List\",\n \"styleType\": \"numbering\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000001\",\n \"children\": [\n {\n \"type\": \"bookmarkStart\",\n \"data\": {\n \"id\": 0,\n \"name\": \"_GoBack\"\n }\n },\n {\n \"type\": \"bookmarkEnd\",\n \"data\": {\n \"id\": 0\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Hello\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360,\n \"headerReference\": {\n \"headerType\": \"default\",\n \"id\": \"rId4\"\n },\n \"sectionType\": null\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100,\n \"docId\": \"58f67304-63b1-4505-b4ba-0c1a55a3ad31\"\n },\n \"fontTable\": {},\n \"media\": [],\n \"header\": {\n \"children\": []\n },\n \"commentsExtended\": {\n \"children\": []\n }\n}" diff --git a/docx-core/tests/snapshots/reader__read_indent_word_online.snap b/docx-core/tests/snapshots/reader__read_indent_word_online.snap index 2923a6d..ec73282 100644 --- a/docx-core/tests/snapshots/reader__read_indent_word_online.snap +++ b/docx-core/tests/snapshots/reader__read_indent_word_online.snap @@ -2,4 +2,4 @@ source: docx-core/tests/reader.rs expression: "&json" --- -"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/commentsExtended.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/header1.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false,\n \"imageIds\": []\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": \"both\",\n \"indent\": null\n }\n },\n {\n \"styleId\": \"DefaultParagraphFont\",\n \"name\": \"Default Paragraph Font\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"TableNormal\",\n \"name\": \"Normal Table\",\n \"styleType\": \"table\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"NoList\",\n \"name\": \"No List\",\n \"styleType\": \"numbering\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000024\",\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 0,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000025\",\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 22,\n \"szCs\": 22,\n \"color\": \"222222\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 840,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"firstLine\",\n \"val\": 0\n }\n }\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000026\",\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 0,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000027\",\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 22,\n \"szCs\": 22,\n \"color\": \"222222\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 840,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"firstLine\",\n \"val\": 720\n }\n }\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000028\",\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 840,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"firstLine\",\n \"val\": 720\n }\n }\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000029\",\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"0000002a\",\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 1560,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 720\n }\n }\n },\n \"hasNumbering\": false\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360,\n \"headerReference\": {\n \"headerType\": \"default\",\n \"id\": \"rId4\"\n },\n \"sectionType\": null\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100,\n \"docId\": null\n },\n \"fontTable\": {},\n \"media\": [],\n \"header\": {\n \"children\": []\n },\n \"commentsExtended\": {\n \"children\": []\n }\n}" +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/commentsExtended.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/header1.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false,\n \"imageIds\": []\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"Normal\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": \"both\",\n \"indent\": null\n }\n },\n {\n \"styleId\": \"DefaultParagraphFont\",\n \"name\": \"Default Paragraph Font\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"TableNormal\",\n \"name\": \"Normal Table\",\n \"styleType\": \"table\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"NoList\",\n \"name\": \"No List\",\n \"styleType\": \"numbering\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000024\",\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 0,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000025\",\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 22,\n \"szCs\": 22,\n \"color\": \"222222\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 840,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"firstLine\",\n \"val\": 0\n }\n }\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000026\",\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 0,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": null\n }\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000027\",\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 22,\n \"szCs\": 22,\n \"color\": \"222222\",\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 840,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"firstLine\",\n \"val\": 720\n }\n }\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000028\",\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 840,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"firstLine\",\n \"val\": 720\n }\n }\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"00000029\",\n \"children\": [],\n \"property\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false\n }\n },\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"0000002a\",\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": 21,\n \"szCs\": 21,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": \"Normal\",\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": {\n \"start\": 1560,\n \"startChars\": null,\n \"end\": null,\n \"specialIndent\": {\n \"type\": \"hanging\",\n \"val\": 720\n }\n }\n },\n \"hasNumbering\": false\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360,\n \"headerReference\": {\n \"headerType\": \"default\",\n \"id\": \"rId4\"\n },\n \"sectionType\": null\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100,\n \"docId\": \"08a45a55-dfcc-4396-aedc-f7a5bfb7db65\"\n },\n \"fontTable\": {},\n \"media\": [],\n \"header\": {\n \"children\": []\n },\n \"commentsExtended\": {\n \"children\": []\n }\n}" diff --git a/docx-core/tests/snapshots/reader__read_textbox.snap b/docx-core/tests/snapshots/reader__read_textbox.snap index 350e6db..350bfc2 100644 --- a/docx-core/tests/snapshots/reader__read_textbox.snap +++ b/docx-core/tests/snapshots/reader__read_textbox.snap @@ -2,4 +2,4 @@ source: docx-core/tests/reader.rs expression: "&json" --- -"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/commentsExtended.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/header1.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false,\n \"imageIds\": []\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"a\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": \"both\",\n \"indent\": null\n }\n },\n {\n \"styleId\": \"a0\",\n \"name\": \"Default Paragraph Font\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"a1\",\n \"name\": \"Normal Table\",\n \"styleType\": \"table\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"a2\",\n \"name\": \"No List\",\n \"styleType\": \"numbering\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"0000004e\",\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"drawing\",\n \"data\": {\n \"position_type\": {\n \"Inline\": {\n \"dist_t\": 0,\n \"dist_b\": 0,\n \"dist_l\": 0,\n \"dist_r\": 0\n }\n },\n \"position_h\": {\n \"Offset\": 0\n },\n \"position_v\": {\n \"Offset\": 0\n },\n \"data\": null,\n \"children\": [\n {\n \"type\": \"anchor\",\n \"data\": {\n \"children\": [\n {\n \"children\": [\n {\n \"dataType\": \"wpShape\",\n \"children\": [\n {\n \"type\": \"shape\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"textbox\",\n \"data\": {\n \"children\": [\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"0000004f\",\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"H\"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"ello\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false\n }\n }\n ],\n \"has_numbering\": false\n }\n ],\n \"hasNumbering\": false\n }\n }\n ]\n }\n }\n ]\n }\n ]\n }\n ]\n }\n }\n ]\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360,\n \"headerReference\": {\n \"headerType\": \"default\",\n \"id\": \"rId4\"\n },\n \"sectionType\": null\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100,\n \"docId\": null\n },\n \"fontTable\": {},\n \"media\": [],\n \"header\": {\n \"children\": []\n },\n \"commentsExtended\": {\n \"children\": []\n }\n}" +"{\n \"contentType\": {\n \"types\": {\n \"/_rels/.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/docProps/app.xml\": \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/core.xml\": \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/word/_rels/document.xml.rels\": \"application/vnd.openxmlformats-package.relationships+xml\",\n \"/word/comments.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/commentsExtended.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml\",\n \"/word/document.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/fontTable.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/header1.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml\",\n \"/word/numbering.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/settings.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/styles.xml\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"\n }\n },\n \"rels\": {\n \"rels\": [\n [\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"rId1\",\n \"docProps/core.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"rId2\",\n \"docProps/app.xml\"\n ],\n [\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"rId3\",\n \"word/document.xml\"\n ]\n ]\n },\n \"documentRels\": {\n \"hasComments\": false,\n \"hasNumberings\": false,\n \"imageIds\": []\n },\n \"docProps\": {\n \"app\": {},\n \"core\": {\n \"config\": {\n \"created\": null,\n \"creator\": null,\n \"description\": null,\n \"language\": null,\n \"lastModifiedBy\": null,\n \"modified\": null,\n \"revision\": null,\n \"subject\": null,\n \"title\": null\n }\n }\n },\n \"styles\": {\n \"docDefaults\": {\n \"runPropertyDefault\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n }\n }\n },\n \"styles\": [\n {\n \"styleId\": \"a\",\n \"name\": \"Normal\",\n \"styleType\": \"paragraph\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": \"both\",\n \"indent\": null\n }\n },\n {\n \"styleId\": \"a0\",\n \"name\": \"Default Paragraph Font\",\n \"styleType\": \"character\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"a1\",\n \"name\": \"Normal Table\",\n \"styleType\": \"table\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n },\n {\n \"styleId\": \"a2\",\n \"name\": \"No List\",\n \"styleType\": \"numbering\",\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"paragraphProperty\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n }\n }\n ]\n },\n \"document\": {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"0000004e\",\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"drawing\",\n \"data\": {\n \"position_type\": {\n \"Inline\": {\n \"dist_t\": 0,\n \"dist_b\": 0,\n \"dist_l\": 0,\n \"dist_r\": 0\n }\n },\n \"position_h\": {\n \"Offset\": 0\n },\n \"position_v\": {\n \"Offset\": 0\n },\n \"data\": null,\n \"children\": [\n {\n \"type\": \"anchor\",\n \"data\": {\n \"children\": [\n {\n \"children\": [\n {\n \"dataType\": \"wpShape\",\n \"children\": [\n {\n \"type\": \"shape\",\n \"data\": {\n \"children\": [\n {\n \"type\": \"textbox\",\n \"data\": {\n \"children\": [\n {\n \"children\": [\n {\n \"type\": \"paragraph\",\n \"data\": {\n \"id\": \"0000004f\",\n \"children\": [\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"H\"\n }\n }\n ]\n }\n },\n {\n \"type\": \"run\",\n \"data\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"children\": [\n {\n \"type\": \"text\",\n \"data\": {\n \"preserveSpace\": true,\n \"text\": \"ello\"\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false\n }\n }\n ],\n \"has_numbering\": false\n }\n ],\n \"hasNumbering\": false\n }\n }\n ]\n }\n }\n ]\n }\n ]\n }\n ]\n }\n }\n ]\n }\n }\n ]\n }\n }\n ],\n \"property\": {\n \"runProperty\": {\n \"sz\": null,\n \"szCs\": null,\n \"color\": null,\n \"highlight\": null,\n \"underline\": null,\n \"bold\": null,\n \"boldCs\": null,\n \"italic\": null,\n \"italicCs\": null,\n \"vanish\": null,\n \"fonts\": null\n },\n \"style\": null,\n \"numberingProperty\": null,\n \"alignment\": null,\n \"indent\": null\n },\n \"hasNumbering\": false\n }\n }\n ],\n \"sectionProperty\": {\n \"pageSize\": {\n \"w\": 11906,\n \"h\": 16838\n },\n \"pageMargin\": {\n \"top\": 1985,\n \"left\": 1701,\n \"bottom\": 1701,\n \"right\": 1701,\n \"header\": 851,\n \"footer\": 992,\n \"gutter\": 0\n },\n \"columns\": 425,\n \"documentGrid\": 360,\n \"headerReference\": {\n \"headerType\": \"default\",\n \"id\": \"rId4\"\n },\n \"sectionType\": null\n },\n \"hasNumbering\": false\n },\n \"comments\": {\n \"comments\": []\n },\n \"numberings\": {\n \"abstractNums\": [],\n \"numberings\": []\n },\n \"settings\": {\n \"defaultTabStop\": 709,\n \"zoom\": 100,\n \"docId\": \"C11ED300-8EA6-3D41-8D67-5E5DE3410CF8\"\n },\n \"fontTable\": {},\n \"media\": [],\n \"header\": {\n \"children\": []\n },\n \"commentsExtended\": {\n \"children\": []\n }\n}" diff --git a/docx-wasm/js/json/document.ts b/docx-wasm/js/json/document.ts index d403d49..ee8098d 100644 --- a/docx-wasm/js/json/document.ts +++ b/docx-wasm/js/json/document.ts @@ -1,7 +1,11 @@ -import { ParagraphJSON } from "./paragraph"; +import { ParagraphJSON, BookmarkStartJSON, BookmarkEndJSON } from "./paragraph"; import { TableJSON } from "./table"; -export type DocumentChildJSON = ParagraphJSON | TableJSON; +export type DocumentChildJSON = + | ParagraphJSON + | TableJSON + | BookmarkStartJSON + | BookmarkEndJSON; export type DocumentJSON = { children: DocumentChildJSON[]; diff --git a/docx-wasm/js/json/index.ts b/docx-wasm/js/json/index.ts index 88dfd2f..378232d 100644 --- a/docx-wasm/js/json/index.ts +++ b/docx-wasm/js/json/index.ts @@ -35,6 +35,8 @@ export type DocxJSON = { }; numberings: NumberingsJSON; settings: { + // w15:docId + docId: string | null; defaultTabStop: number; zoom: number; };