diff --git a/docx-core/examples/reader.rs b/docx-core/examples/reader.rs index 457ceaf..50719b9 100644 --- a/docx-core/examples/reader.rs +++ b/docx-core/examples/reader.rs @@ -4,7 +4,7 @@ use std::fs::File; use std::io::{Read, Write}; pub fn main() { - let mut file = File::open("./fixtures/custom/custom.docx").unwrap(); + let mut file = File::open("./spacing.docx").unwrap(); let mut buf = vec![]; file.read_to_end(&mut buf).unwrap(); diff --git a/docx-core/src/documents/elements/line_spacing.rs b/docx-core/src/documents/elements/line_spacing.rs index f6f05b9..80a0112 100644 --- a/docx-core/src/documents/elements/line_spacing.rs +++ b/docx-core/src/documents/elements/line_spacing.rs @@ -4,7 +4,7 @@ use crate::xml_builder::*; use crate::line_spacing_type::LineSpacingType; use serde::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)] #[serde(rename_all = "camelCase")] pub struct LineSpacing { #[serde(skip_serializing_if = "Option::is_none")] @@ -14,28 +14,45 @@ pub struct LineSpacing { #[serde(skip_serializing_if = "Option::is_none")] after: Option, #[serde(skip_serializing_if = "Option::is_none")] + before_lines: Option, + #[serde(skip_serializing_if = "Option::is_none")] + after_lines: Option, + #[serde(skip_serializing_if = "Option::is_none")] line: Option, } impl LineSpacing { - pub fn new(spacing: Option) -> Self { - Self { - line_rule: spacing, - before: None, - after: None, - line: None, - } + pub fn new() -> Self { + Self::default() } - pub fn before(mut self, before: Option) -> Self { - self.before = before; + + pub fn line_rule(mut self, t: LineSpacingType) -> Self { + self.line_rule = Some(t); self } - pub fn after(mut self, after: Option) -> Self { - self.after = after; + + pub fn before(mut self, before: u32) -> Self { + self.before = Some(before); self } - pub fn line(mut self, line: Option) -> Self { - self.line = line; + + pub fn after(mut self, after: u32) -> Self { + self.after = Some(after); + self + } + + pub fn before_lines(mut self, before: u32) -> Self { + self.before_lines = Some(before); + self + } + + pub fn after_lines(mut self, after: u32) -> Self { + self.after_lines = Some(after); + self + } + + pub fn line(mut self, line: u32) -> Self { + self.line = Some(line); self } } @@ -43,8 +60,15 @@ impl LineSpacing { impl BuildXML for LineSpacing { fn build(&self) -> Vec { let b = XMLBuilder::new(); - b.line_spacing(self.before, self.after, self.line, self.line_rule) - .build() + b.line_spacing( + self.before, + self.after, + self.line, + self.before_lines, + self.after_lines, + self.line_rule, + ) + .build() } } @@ -58,8 +82,9 @@ mod tests { #[test] fn test_spacing() { - let b = LineSpacing::new(Some(LineSpacingType::Auto)) - .line(Some(100)) + let b = LineSpacing::new() + .line_rule(LineSpacingType::Auto) + .line(100) .build(); assert_eq!( str::from_utf8(&b).unwrap(), @@ -67,12 +92,26 @@ mod tests { ); } + #[test] + fn test_spacing_after_lines() { + let b = LineSpacing::new() + .line_rule(LineSpacingType::Auto) + .after_lines(100) + .build(); + assert_eq!( + str::from_utf8(&b).unwrap(), + r#""# + ); + } + #[test] fn test_spacing_json() { let s = LineSpacing { line_rule: Some(LineSpacingType::Auto), before: None, after: None, + before_lines: None, + after_lines: None, line: Some(100), }; assert_eq!( diff --git a/docx-core/src/documents/elements/paragraph.rs b/docx-core/src/documents/elements/paragraph.rs index c2a21f9..01439ed 100644 --- a/docx-core/src/documents/elements/paragraph.rs +++ b/docx-core/src/documents/elements/paragraph.rs @@ -244,16 +244,8 @@ impl Paragraph { self } - pub fn line_spacing( - mut self, - before: Option, - after: Option, - line: Option, - spacing_type: Option, - ) -> Self { - self.property = self - .property - .line_spacing(before, after, line, spacing_type); + pub fn line_spacing(mut self, spacing: LineSpacing) -> Self { + self.property = self.property.line_spacing(spacing); self } } @@ -334,8 +326,13 @@ mod tests { #[test] fn test_line_spacing_and_character_spacing() { + let spacing = LineSpacing::new() + .line_rule(LineSpacingType::Auto) + .before(20) + .after(30) + .line(200); let b = Paragraph::new() - .line_spacing(Some(20), Some(30), Some(200), Some(LineSpacingType::Auto)) + .line_spacing(spacing) .add_run(Run::new().add_text("Hello")) .build(); assert_eq!( diff --git a/docx-core/src/documents/elements/paragraph_property.rs b/docx-core/src/documents/elements/paragraph_property.rs index 7605678..ec35552 100644 --- a/docx-core/src/documents/elements/paragraph_property.rs +++ b/docx-core/src/documents/elements/paragraph_property.rs @@ -2,7 +2,7 @@ use serde::Serialize; use super::*; use crate::documents::BuildXML; -use crate::types::{AlignmentType, LineSpacingType, SpecialIndentType}; +use crate::types::{AlignmentType, SpecialIndentType}; use crate::xml_builder::*; #[derive(Serialize, Debug, Clone, PartialEq)] @@ -78,19 +78,8 @@ impl ParagraphProperty { self } - pub fn line_spacing( - mut self, - before: Option, - after: Option, - line: Option, - spacing_type: Option, - ) -> Self { - self.line_spacing = Some( - LineSpacing::new(spacing_type) - .after(after) - .before(before) - .line(line), - ); + pub fn line_spacing(mut self, spacing: LineSpacing) -> Self { + self.line_spacing = Some(spacing); self } @@ -173,6 +162,7 @@ impl BuildXML for ParagraphProperty { mod tests { use super::*; + use crate::types::LineSpacingType; #[cfg(test)] use pretty_assertions::assert_eq; use std::str; @@ -238,9 +228,10 @@ mod tests { #[test] fn test_line_spacing() { let props = ParagraphProperty::new(); - let bytes = props - .line_spacing(None, None, Some(100), Some(LineSpacingType::AtLeast)) - .build(); + let spacing = LineSpacing::new() + .line_rule(LineSpacingType::AtLeast) + .line(100); + let bytes = props.line_spacing(spacing).build(); assert_eq!( str::from_utf8(&bytes).unwrap(), r#""# diff --git a/docx-core/src/reader/attributes/line_spacing.rs b/docx-core/src/reader/attributes/line_spacing.rs index a75a23c..075e313 100644 --- a/docx-core/src/reader/attributes/line_spacing.rs +++ b/docx-core/src/reader/attributes/line_spacing.rs @@ -1,34 +1,34 @@ use crate::line_spacing_type::LineSpacingType; +use crate::LineSpacing; use crate::ReaderError; use std::str::FromStr; use xml::attribute::OwnedAttribute; -pub type LineSpacingResult = Result< - ( - Option, - Option, - Option, - Option, - ), - ReaderError, ->; - -pub fn read_line_spacing(attributes: &[OwnedAttribute]) -> LineSpacingResult { - let mut before: Option = None; - let mut after: Option = None; - let mut line: Option = None; - let mut spacing_type: Option = None; +pub fn read_line_spacing(attributes: &[OwnedAttribute]) -> Result { + let mut spacing = LineSpacing::new(); for a in attributes { let local_name = &a.name.local_name; - if local_name == "before" { - before = Some(u32::from_str(&a.value)?); - } else if local_name == "after" { - after = Some(u32::from_str(&a.value)?); - } else if local_name == "line" { - line = Some(u32::from_str(&a.value)?); - } else if local_name == "lineRule" { - spacing_type = Some(LineSpacingType::from_str(&a.value)?); + match local_name.as_str() { + "before" => { + spacing = spacing.before(u32::from_str(&a.value)?); + } + "after" => { + spacing = spacing.after(u32::from_str(&a.value)?); + } + "line" => { + spacing = spacing.line(u32::from_str(&a.value)?); + } + "lineRule" => { + spacing = spacing.line_rule(LineSpacingType::from_str(&a.value)?); + } + "beforeLines" => { + spacing = spacing.before_lines(u32::from_str(&a.value)?); + } + "afterLines" => { + spacing = spacing.after_lines(u32::from_str(&a.value)?); + } + _ => {} } } - Ok((before, after, line, spacing_type)) + Ok(spacing) } diff --git a/docx-core/src/reader/paragraph_property.rs b/docx-core/src/reader/paragraph_property.rs index 8e66a8f..e704532 100644 --- a/docx-core/src/reader/paragraph_property.rs +++ b/docx-core/src/reader/paragraph_property.rs @@ -40,9 +40,11 @@ impl ElementReader for ParagraphProperty { continue; } XMLElement::Spacing => { - let (before, after, line, spacing_type) = - attributes::line_spacing::read_line_spacing(&attributes)?; - p = p.line_spacing(before, after, line, spacing_type); + if let Ok(spacing) = + attributes::line_spacing::read_line_spacing(&attributes) + { + p = p.line_spacing(spacing); + } continue; } XMLElement::Justification => { diff --git a/docx-core/src/xml_builder/elements.rs b/docx-core/src/xml_builder/elements.rs index 81a0262..38d73d7 100644 --- a/docx-core/src/xml_builder/elements.rs +++ b/docx-core/src/xml_builder/elements.rs @@ -167,11 +167,15 @@ impl XMLBuilder { before: Option, after: Option, line: Option, + before_lines: Option, + after_lines: Option, spacing: Option, ) -> Self { let mut xml_event = XmlEvent::start_element("w:spacing"); let before_val: String; let after_val: String; + let before_lines_val: String; + let after_lines_val: String; let line_val: String; if let Some(before) = before { @@ -182,6 +186,14 @@ impl XMLBuilder { after_val = format!("{}", after); xml_event = xml_event.attr("w:after", &after_val) } + if let Some(before_lines) = before_lines { + before_lines_val = format!("{}", before_lines); + xml_event = xml_event.attr("w:beforeLines", &before_lines_val) + } + if let Some(after_lines) = after_lines { + after_lines_val = format!("{}", after_lines); + xml_event = xml_event.attr("w:afterLines", &after_lines_val) + } if let Some(line) = line { line_val = format!("{}", line); xml_event = xml_event.attr("w:line", &line_val) diff --git a/docx-core/tests/lib.rs b/docx-core/tests/lib.rs index 848a493..9772da1 100644 --- a/docx-core/tests/lib.rs +++ b/docx-core/tests/lib.rs @@ -420,21 +420,36 @@ pub fn date() -> Result<(), DocxError> { pub fn line_spacing() -> Result<(), DocxError> { let path = std::path::Path::new("./tests/output/line_spacing.docx"); let file = std::fs::File::create(&path).unwrap(); + Docx::new() .add_paragraph( Paragraph::new() .add_run(Run::new().add_text(DUMMY)) - .line_spacing(Some(300), None, Some(300), Some(LineSpacingType::Auto)), + .line_spacing( + LineSpacing::new() + .before(300) + .line(300) + .line_rule(LineSpacingType::Auto), + ), ) .add_paragraph( Paragraph::new() .add_run(Run::new().add_text(DUMMY)) - .line_spacing(None, None, Some(300), Some(LineSpacingType::AtLeast)), + .line_spacing( + LineSpacing::new() + .line(300) + .line_rule(LineSpacingType::AtLeast), + ), ) .add_paragraph( Paragraph::new() .add_run(Run::new().add_text(DUMMY).character_spacing(100)) - .line_spacing(None, Some(300), Some(300), Some(LineSpacingType::Exact)), + .line_spacing( + LineSpacing::new() + .after(300) + .line(300) + .line_rule(LineSpacingType::Exact), + ), ) .build() .pack(file)?; diff --git a/docx-wasm/js/index.ts b/docx-wasm/js/index.ts index eff97cc..62861d8 100644 --- a/docx-wasm/js/index.ts +++ b/docx-wasm/js/index.ts @@ -1,4 +1,4 @@ -import { Paragraph } from "./paragraph"; +import { Paragraph, ParagraphProperty } from "./paragraph"; import { Insert } from "./insert"; import { Delete } from "./delete"; import { DeleteText } from "./delete-text"; @@ -339,6 +339,51 @@ export class Docx { return comment; } + buildLineSpacing(p: ParagraphProperty): wasm.LineSpacing | null { + const { lineSpacing } = p; + if (lineSpacing == null) return null; + let kind; + switch (lineSpacing._lineRule) { + case "atLeast": { + kind = wasm.LineSpacingType.AtLeast; + break; + } + case "auto": { + kind = wasm.LineSpacingType.Auto; + break; + } + case "exact": { + kind = wasm.LineSpacingType.Exact; + break; + } + } + let spacing = wasm.createLineSpacing(); + if (lineSpacing._before != null) { + spacing = spacing.before(lineSpacing._before); + } + + if (lineSpacing._after != null) { + spacing = spacing.after(lineSpacing._after); + } + + if (lineSpacing._beforeLines != null) { + spacing = spacing.before_lines(lineSpacing._beforeLines); + } + + if (lineSpacing._afterLines != null) { + spacing = spacing.after_lines(lineSpacing._afterLines); + } + + if (lineSpacing._line != null) { + spacing = spacing.line(lineSpacing._line); + } + + if (kind != null) { + spacing = spacing.line_rule(kind); + } + return spacing; + } + buildParagraph(p: Paragraph) { let paragraph = wasm.createParagraph(); p.children.forEach((child) => { @@ -424,28 +469,10 @@ export class Docx { } if (typeof p.property.lineSpacing !== "undefined") { - const { lineSpacing } = p.property; - let kind; - switch (p.property.lineSpacing.lineRule) { - case "atLeast": { - kind = wasm.LineSpacingType.AtLeast; - break; - } - case "auto": { - kind = wasm.LineSpacingType.Auto; - break; - } - case "exact": { - kind = wasm.LineSpacingType.Exact; - break; - } + const spacing = this.buildLineSpacing(p.property); + if (spacing) { + paragraph = paragraph.line_spacing(spacing); } - paragraph = paragraph.line_spacing( - lineSpacing.before, - lineSpacing.after, - lineSpacing.line, - kind - ); } if (p.property.runProperty.italic) { diff --git a/docx-wasm/js/paragraph.ts b/docx-wasm/js/paragraph.ts index 8a37000..e14f4e0 100644 --- a/docx-wasm/js/paragraph.ts +++ b/docx-wasm/js/paragraph.ts @@ -1,181 +1,205 @@ -import {Run, RunProperty, RunFonts, createDefaultRunProperty} from "./run"; -import {Insert} from "./insert"; -import {Delete} from "./delete"; -import {BookmarkStart} from "./bookmark-start"; -import {BookmarkEnd} from "./bookmark-end"; -import {Comment} from "./comment"; -import {CommentEnd} from "./comment-end"; +import { Run, RunProperty, RunFonts, createDefaultRunProperty } from "./run"; +import { Insert } from "./insert"; +import { Delete } from "./delete"; +import { BookmarkStart } from "./bookmark-start"; +import { BookmarkEnd } from "./bookmark-end"; +import { Comment } from "./comment"; +import { CommentEnd } from "./comment-end"; export type ParagraphChild = - | Run - | Insert - | Delete - | BookmarkStart - | BookmarkEnd - | Comment - | CommentEnd; + | Run + | Insert + | Delete + | BookmarkStart + | BookmarkEnd + | Comment + | CommentEnd; export type AlignmentType = - | "center" - | "left" - | "right" - | "both" - | "justified" - | "distribute" - | "end"; + | "center" + | "left" + | "right" + | "both" + | "justified" + | "distribute" + | "end"; export type SpecialIndentKind = "firstLine" | "hanging"; -export type LineSpacingType = "atLeast" | "auto" | "exact" +export type LineSpacingType = "atLeast" | "auto" | "exact"; + +export class LineSpacing { + _before?: number; + _after?: number; + _beforeLines?: number; + _afterLines?: number; + _line?: number; + _lineRule?: LineSpacingType; + + before(v: number) { + this._before = v; + return this; + } + after(v: number) { + this._after = v; + return this; + } + beforeLines(v: number) { + this._beforeLines = v; + return this; + } + afterLines(v: number) { + this._afterLines = v; + return this; + } + line(v: number) { + this._line = v; + return this; + } + lineRule(v: LineSpacingType) { + this._lineRule = v; + return this; + } +} export type ParagraphProperty = { - align?: AlignmentType; - styleId?: string; - indent?: { - left: number; - specialIndentKind?: SpecialIndentKind; - specialIndentSize?: number; - }; - numbering?: { - id: number; - level: number; - }; - lineSpacing?: { - before?: number; - after?: number; - line?: number; - lineRule?: LineSpacingType; - }; - runProperty: RunProperty; - keepNext: boolean; - keepLines: boolean; - pageBreakBefore: boolean; - windowControl: boolean; + align?: AlignmentType; + styleId?: string; + indent?: { + left: number; + specialIndentKind?: SpecialIndentKind; + specialIndentSize?: number; + }; + numbering?: { + id: number; + level: number; + }; + lineSpacing?: LineSpacing; + runProperty: RunProperty; + keepNext: boolean; + keepLines: boolean; + pageBreakBefore: boolean; + windowControl: boolean; }; export const createDefaultParagraphProperty = (): ParagraphProperty => { - return { - runProperty: createDefaultRunProperty(), - keepNext: false, - keepLines: false, - pageBreakBefore: false, - windowControl: false, - }; + return { + runProperty: createDefaultRunProperty(), + keepNext: false, + keepLines: false, + pageBreakBefore: false, + windowControl: false, + }; }; export class Paragraph { - hasNumberings = false; - children: ParagraphChild[] = []; - property: ParagraphProperty = createDefaultParagraphProperty(); + hasNumberings = false; + children: ParagraphChild[] = []; + property: ParagraphProperty = createDefaultParagraphProperty(); - addRun(run: Run) { - this.children.push(run); - return this; - } + addRun(run: Run) { + this.children.push(run); + return this; + } - addInsert(ins: Insert) { - this.children.push(ins); - return this; - } + addInsert(ins: Insert) { + this.children.push(ins); + return this; + } - addDelete(del: Delete) { - this.children.push(del); - return this; - } + addDelete(del: Delete) { + this.children.push(del); + return this; + } - addBookmarkStart(id: number, name: string) { - this.children.push(new BookmarkStart(id, name)); - return this; - } + addBookmarkStart(id: number, name: string) { + this.children.push(new BookmarkStart(id, name)); + return this; + } - addBookmarkEnd(id: number) { - this.children.push(new BookmarkEnd(id)); - return this; - } + addBookmarkEnd(id: number) { + this.children.push(new BookmarkEnd(id)); + return this; + } - addCommentStart(comment: Comment) { - this.children.push(comment); - return this; - } + addCommentStart(comment: Comment) { + this.children.push(comment); + return this; + } - addCommentEnd(end: CommentEnd) { - this.children.push(end); - return this; - } + addCommentEnd(end: CommentEnd) { + this.children.push(end); + return this; + } - align(type: AlignmentType) { - this.property.align = type; - return this; - } + align(type: AlignmentType) { + this.property.align = type; + return this; + } - style(id: string) { - this.property.styleId = id; - return this; - } + style(id: string) { + this.property.styleId = id; + return this; + } - indent( - left: number, - specialIndentKind?: SpecialIndentKind, - specialIndentSize?: number - ) { - this.property.indent = {left, specialIndentKind, specialIndentSize}; - return this; - } + indent( + left: number, + specialIndentKind?: SpecialIndentKind, + specialIndentSize?: number + ) { + this.property.indent = { left, specialIndentKind, specialIndentSize }; + return this; + } - numbering(id: number, level: number) { - this.hasNumberings = true; - this.property.numbering = {id, level}; - return this; - } + numbering(id: number, level: number) { + this.hasNumberings = true; + this.property.numbering = { id, level }; + return this; + } - lineSpacing(before?: number, after?: number, line?: number, lineRule?: LineSpacingType) { - this.property.lineSpacing = { - before, - after, - line, - lineRule - } - return this; - } + lineSpacing(spacing: LineSpacing) { + this.property.lineSpacing = spacing; + return this; + } - keepNext(v: boolean) { - this.property = {...this.property, keepNext: v}; - return this; - } + keepNext(v: boolean) { + this.property = { ...this.property, keepNext: v }; + return this; + } - keepLines(v: boolean) { - this.property = {...this.property, keepLines: v}; - return this; - } + keepLines(v: boolean) { + this.property = { ...this.property, keepLines: v }; + return this; + } - pageBreakBefore(v: boolean) { - this.property = {...this.property, pageBreakBefore: v}; - return this; - } + pageBreakBefore(v: boolean) { + this.property = { ...this.property, pageBreakBefore: v }; + return this; + } - windowControl(v: boolean) { - this.property = {...this.property, windowControl: v}; - return this; - } + windowControl(v: boolean) { + this.property = { ...this.property, windowControl: v }; + return this; + } - // run property - size(size: number) { - this.property.runProperty = {...this.property.runProperty, size}; - return this; - } + // run property + size(size: number) { + this.property.runProperty = { ...this.property.runProperty, size }; + return this; + } - bold() { - this.property.runProperty = {...this.property.runProperty, bold: true}; - return this; - } + bold() { + this.property.runProperty = { ...this.property.runProperty, bold: true }; + return this; + } - italic() { - this.property.runProperty = {...this.property.runProperty, italic: true}; - return this; - } + italic() { + this.property.runProperty = { ...this.property.runProperty, italic: true }; + return this; + } - fonts(fonts: RunFonts) { - this.property.runProperty = {...this.property.runProperty, fonts}; - return this; - } + fonts(fonts: RunFonts) { + this.property.runProperty = { ...this.property.runProperty, fonts }; + return this; + } } diff --git a/docx-wasm/src/lib.rs b/docx-wasm/src/lib.rs index 8444869..3b3b4cf 100644 --- a/docx-wasm/src/lib.rs +++ b/docx-wasm/src/lib.rs @@ -7,6 +7,7 @@ mod footer; mod insert; mod level; mod level_override; +mod line_spacing; mod numbering; mod page_margin; mod paragraph; @@ -28,6 +29,7 @@ pub use footer::*; pub use insert::*; pub use level::*; pub use level_override::*; +pub use line_spacing::*; pub use numbering::*; pub use page_margin::*; pub use paragraph::*; diff --git a/docx-wasm/src/line_spacing.rs b/docx-wasm/src/line_spacing.rs new file mode 100644 index 0000000..3694977 --- /dev/null +++ b/docx-wasm/src/line_spacing.rs @@ -0,0 +1,49 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[derive(Debug)] +pub struct LineSpacing(docx_rs::LineSpacing); + +#[wasm_bindgen(js_name = createLineSpacing)] +pub fn create_line_spacing() -> LineSpacing { + LineSpacing(docx_rs::LineSpacing::new()) +} + +impl LineSpacing { + pub fn take(self) -> docx_rs::LineSpacing { + self.0 + } +} + +#[wasm_bindgen] +impl LineSpacing { + pub fn line_rule(mut self, t: docx_rs::LineSpacingType) -> Self { + self.0 = self.0.line_rule(t); + self + } + + pub fn before(mut self, before: u32) -> Self { + self.0 = self.0.before(before); + self + } + + pub fn after(mut self, after: u32) -> Self { + self.0 = self.0.after(after); + self + } + + pub fn before_lines(mut self, before: u32) -> Self { + self.0 = self.0.before_lines(before); + self + } + + pub fn after_lines(mut self, after: u32) -> Self { + self.0 = self.0.after_lines(after); + self + } + + pub fn line(mut self, line: u32) -> Self { + self.0 = self.0.line(line); + self + } +} diff --git a/docx-wasm/src/paragraph.rs b/docx-wasm/src/paragraph.rs index 4c1f3e7..827ae45 100644 --- a/docx-wasm/src/paragraph.rs +++ b/docx-wasm/src/paragraph.rs @@ -112,14 +112,8 @@ impl Paragraph { self } - pub fn line_spacing( - mut self, - before: Option, - after: Option, - line: Option, - spacing_type: Option, - ) -> Self { - self.0 = self.0.line_spacing(before, after, line, spacing_type); + pub fn line_spacing(mut self, spacing: LineSpacing) -> Self { + self.0 = self.0.line_spacing(spacing.take()); self } diff --git a/docx-wasm/test/__snapshots__/index.test.js.snap b/docx-wasm/test/__snapshots__/index.test.js.snap index 750411a..757264a 100644 --- a/docx-wasm/test/__snapshots__/index.test.js.snap +++ b/docx-wasm/test/__snapshots__/index.test.js.snap @@ -1,5 +1,1572 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`reader should read afterLines docx 1`] = ` +Object { + "comments": Object { + "comments": Array [], + }, + "commentsExtended": Object { + "children": Array [], + }, + "contentType": Object { + "custom_xml_count": 1, + "footer_count": 1, + "types": Object { + "/_rels/.rels": "application/vnd.openxmlformats-package.relationships+xml", + "/docProps/app.xml": "application/vnd.openxmlformats-officedocument.extended-properties+xml", + "/docProps/core.xml": "application/vnd.openxmlformats-package.core-properties+xml", + "/docProps/custom.xml": "application/vnd.openxmlformats-officedocument.custom-properties+xml", + "/word/_rels/document.xml.rels": "application/vnd.openxmlformats-package.relationships+xml", + "/word/comments.xml": "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml", + "/word/commentsExtended.xml": "application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml", + "/word/document.xml": "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml", + "/word/fontTable.xml": "application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml", + "/word/header1.xml": "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml", + "/word/numbering.xml": "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml", + "/word/settings.xml": "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml", + "/word/styles.xml": "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml", + }, + "web_extension_count": 1, + }, + "customItemProps": Array [], + "customItemRels": Array [], + "customItems": Array [], + "docProps": Object { + "app": Object {}, + "core": Object { + "config": Object { + "created": null, + "creator": null, + "description": null, + "language": null, + "lastModifiedBy": null, + "modified": null, + "revision": null, + "subject": null, + "title": null, + }, + }, + "custom": Object { + "properties": Object {}, + }, + }, + "document": Object { + "children": Array [ + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "preserveSpace": true, + "text": "第1条 ", + }, + "type": "text", + }, + ], + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + }, + "type": "run", + }, + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "preserveSpace": true, + "text": "ほげほげほげ", + }, + "type": "text", + }, + ], + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + }, + "type": "run", + }, + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "preserveSpace": true, + "text": "ー", + }, + "type": "text", + }, + ], + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + }, + "type": "run", + }, + ], + "hasNumbering": false, + "id": "78D5F6F5", + "property": Object { + "alignment": null, + "divId": null, + "indent": null, + "keepLines": false, + "keepNext": false, + "lineSpacing": null, + "numberingProperty": null, + "outlineLvl": null, + "pageBreakBefore": false, + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + "style": null, + "windowControl": false, + }, + }, + "type": "paragraph", + }, + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "preserveSpace": true, + "text": "    こんにちは、こんにちは。", + }, + "type": "text", + }, + ], + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + }, + "type": "run", + }, + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "preserveSpace": true, + "text": "Space after", + }, + "type": "text", + }, + ], + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + }, + "type": "run", + }, + ], + "hasNumbering": false, + "id": "47E607A1", + "property": Object { + "alignment": null, + "divId": null, + "indent": null, + "keepLines": false, + "keepNext": false, + "lineSpacing": Object { + "after": 720, + }, + "numberingProperty": null, + "outlineLvl": null, + "pageBreakBefore": false, + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + "style": null, + "windowControl": false, + }, + }, + "type": "paragraph", + }, + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "preserveSpace": true, + "text": "第", + }, + "type": "text", + }, + ], + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + }, + "type": "run", + }, + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "preserveSpace": true, + "text": "2", + }, + "type": "text", + }, + ], + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + }, + "type": "run", + }, + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "preserveSpace": true, + "text": "条 ", + }, + "type": "text", + }, + ], + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + }, + "type": "run", + }, + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "preserveSpace": true, + "text": "ほげほげほげ", + }, + "type": "text", + }, + ], + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + }, + "type": "run", + }, + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "preserveSpace": true, + "text": "ー", + }, + "type": "text", + }, + ], + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + }, + "type": "run", + }, + ], + "hasNumbering": false, + "id": "1D02E472", + "property": Object { + "alignment": null, + "divId": null, + "indent": null, + "keepLines": false, + "keepNext": false, + "lineSpacing": null, + "numberingProperty": null, + "outlineLvl": null, + "pageBreakBefore": false, + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + "style": null, + "windowControl": false, + }, + }, + "type": "paragraph", + }, + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "preserveSpace": true, + "text": "    こんにちは、こんにちは。", + }, + "type": "text", + }, + ], + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + }, + "type": "run", + }, + ], + "hasNumbering": false, + "id": "1302AFDA", + "property": Object { + "alignment": null, + "divId": null, + "indent": null, + "keepLines": false, + "keepNext": false, + "lineSpacing": null, + "numberingProperty": null, + "outlineLvl": null, + "pageBreakBefore": false, + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + "style": null, + "windowControl": false, + }, + }, + "type": "paragraph", + }, + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "preserveSpace": true, + "text": "第", + }, + "type": "text", + }, + ], + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + }, + "type": "run", + }, + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "preserveSpace": true, + "text": "3", + }, + "type": "text", + }, + ], + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + }, + "type": "run", + }, + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "preserveSpace": true, + "text": "条 ", + }, + "type": "text", + }, + ], + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + }, + "type": "run", + }, + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "preserveSpace": true, + "text": "ほげほげほげ", + }, + "type": "text", + }, + ], + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + }, + "type": "run", + }, + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "preserveSpace": true, + "text": "ー", + }, + "type": "text", + }, + ], + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + }, + "type": "run", + }, + ], + "hasNumbering": false, + "id": "3C9869CF", + "property": Object { + "alignment": null, + "divId": null, + "indent": null, + "keepLines": false, + "keepNext": false, + "lineSpacing": Object { + "before": 720, + "beforeLines": 200, + }, + "numberingProperty": null, + "outlineLvl": null, + "pageBreakBefore": false, + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + "style": null, + "windowControl": false, + }, + }, + "type": "paragraph", + }, + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "preserveSpace": true, + "text": "    こんにちは、こんにちは", + }, + "type": "text", + }, + ], + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + }, + "type": "run", + }, + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "preserveSpace": true, + "text": "。", + }, + "type": "text", + }, + ], + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + }, + "type": "run", + }, + Object { + "data": Object { + "children": Array [ + Object { + "data": Object { + "preserveSpace": true, + "text": "Space before", + }, + "type": "text", + }, + ], + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + }, + "type": "run", + }, + ], + "hasNumbering": false, + "id": "3E200AEF", + "property": Object { + "alignment": null, + "divId": null, + "indent": null, + "keepLines": false, + "keepNext": false, + "lineSpacing": null, + "numberingProperty": null, + "outlineLvl": null, + "pageBreakBefore": false, + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + "style": null, + "windowControl": false, + }, + }, + "type": "paragraph", + }, + Object { + "data": Object { + "children": Array [], + "hasNumbering": false, + "id": "4047C950", + "property": Object { + "alignment": null, + "divId": null, + "indent": null, + "keepLines": false, + "keepNext": false, + "lineSpacing": null, + "numberingProperty": null, + "outlineLvl": null, + "pageBreakBefore": false, + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + "style": null, + "windowControl": false, + }, + }, + "type": "paragraph", + }, + ], + "hasNumbering": false, + "sectionProperty": Object { + "columns": 425, + "docGrid": Object { + "charSpace": null, + "gridType": "lines", + "linePitch": 360, + }, + "footerReference": null, + "headerReference": Object { + "headerType": "default", + "id": "rId4", + }, + "pageMargin": Object { + "bottom": 1701, + "footer": 992, + "gutter": 0, + "header": 851, + "left": 1701, + "right": 1701, + "top": 1985, + }, + "pageSize": Object { + "h": 16840, + "orient": null, + "w": 11900, + }, + "sectionType": null, + }, + }, + "documentRels": Object { + "customXmlCount": 0, + "footerCount": 0, + "hasComments": false, + "hasNumberings": false, + "imageIds": Array [], + }, + "fontTable": Object {}, + "footer": null, + "header": Object { + "children": Array [], + }, + "media": Array [], + "numberings": Object { + "abstractNums": Array [], + "numberings": Array [], + }, + "rels": Object { + "rels": Array [ + Array [ + "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties", + "rId1", + "docProps/core.xml", + ], + Array [ + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties", + "rId2", + "docProps/app.xml", + ], + Array [ + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", + "rId3", + "word/document.xml", + ], + Array [ + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties", + "rId4", + "docProps/custom.xml", + ], + ], + }, + "settings": Object { + "defaultTabStop": 840, + "docId": "FB0AE6E2-8FB8-3345-A8FC-78CE6F3ABE4E", + "docVars": Array [], + "zoom": 100, + }, + "styles": Object { + "docDefaults": Object { + "runPropertyDefault": Object { + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": 21, + "szCs": 21, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + }, + }, + "styles": Array [ + Object { + "basedOn": null, + "name": "Normal", + "paragraphProperty": Object { + "alignment": "both", + "divId": null, + "indent": null, + "keepLines": false, + "keepNext": false, + "lineSpacing": null, + "numberingProperty": null, + "outlineLvl": null, + "pageBreakBefore": false, + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + "style": null, + "windowControl": false, + }, + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + "styleId": "a", + "styleType": "paragraph", + "tableCellProperty": Object { + "borders": null, + "gridSpan": null, + "shading": null, + "textDirection": null, + "verticalAlign": null, + "verticalMerge": null, + "width": null, + }, + "tableProperty": Object { + "borders": Object { + "bottom": Object { + "borderType": "single", + "color": "000000", + "position": "bottom", + "size": 2, + "space": 0, + }, + "insideH": Object { + "borderType": "single", + "color": "000000", + "position": "insideH", + "size": 2, + "space": 0, + }, + "insideV": Object { + "borderType": "single", + "color": "000000", + "position": "insideV", + "size": 2, + "space": 0, + }, + "left": Object { + "borderType": "single", + "color": "000000", + "position": "left", + "size": 2, + "space": 0, + }, + "right": Object { + "borderType": "single", + "color": "000000", + "position": "right", + "size": 2, + "space": 0, + }, + "top": Object { + "borderType": "single", + "color": "000000", + "position": "top", + "size": 2, + "space": 0, + }, + }, + "indent": null, + "justification": "left", + "layout": null, + "margins": Object { + "bottom": Object { + "val": 0, + "widthType": "DXA", + }, + "left": Object { + "val": 55, + "widthType": "DXA", + }, + "right": Object { + "val": 55, + "widthType": "DXA", + }, + "top": Object { + "val": 0, + "widthType": "DXA", + }, + }, + "style": null, + "width": Object { + "width": 0, + "widthType": "Auto", + }, + }, + }, + Object { + "basedOn": null, + "name": "Default Paragraph Font", + "paragraphProperty": Object { + "alignment": null, + "divId": null, + "indent": null, + "keepLines": false, + "keepNext": false, + "lineSpacing": null, + "numberingProperty": null, + "outlineLvl": null, + "pageBreakBefore": false, + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + "style": null, + "windowControl": false, + }, + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + "styleId": "a0", + "styleType": "character", + "tableCellProperty": Object { + "borders": null, + "gridSpan": null, + "shading": null, + "textDirection": null, + "verticalAlign": null, + "verticalMerge": null, + "width": null, + }, + "tableProperty": Object { + "borders": Object { + "bottom": Object { + "borderType": "single", + "color": "000000", + "position": "bottom", + "size": 2, + "space": 0, + }, + "insideH": Object { + "borderType": "single", + "color": "000000", + "position": "insideH", + "size": 2, + "space": 0, + }, + "insideV": Object { + "borderType": "single", + "color": "000000", + "position": "insideV", + "size": 2, + "space": 0, + }, + "left": Object { + "borderType": "single", + "color": "000000", + "position": "left", + "size": 2, + "space": 0, + }, + "right": Object { + "borderType": "single", + "color": "000000", + "position": "right", + "size": 2, + "space": 0, + }, + "top": Object { + "borderType": "single", + "color": "000000", + "position": "top", + "size": 2, + "space": 0, + }, + }, + "indent": null, + "justification": "left", + "layout": null, + "margins": Object { + "bottom": Object { + "val": 0, + "widthType": "DXA", + }, + "left": Object { + "val": 55, + "widthType": "DXA", + }, + "right": Object { + "val": 55, + "widthType": "DXA", + }, + "top": Object { + "val": 0, + "widthType": "DXA", + }, + }, + "style": null, + "width": Object { + "width": 0, + "widthType": "Auto", + }, + }, + }, + Object { + "basedOn": null, + "name": "Normal Table", + "paragraphProperty": Object { + "alignment": null, + "divId": null, + "indent": null, + "keepLines": false, + "keepNext": false, + "lineSpacing": null, + "numberingProperty": null, + "outlineLvl": null, + "pageBreakBefore": false, + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + "style": null, + "windowControl": false, + }, + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + "styleId": "a1", + "styleType": "table", + "tableCellProperty": Object { + "borders": null, + "gridSpan": null, + "shading": null, + "textDirection": null, + "verticalAlign": null, + "verticalMerge": null, + "width": null, + }, + "tableProperty": Object { + "borders": Object { + "bottom": null, + "insideH": null, + "insideV": null, + "left": null, + "right": null, + "top": null, + }, + "indent": null, + "justification": "left", + "layout": null, + "margins": Object { + "bottom": Object { + "val": 0, + "widthType": "DXA", + }, + "left": Object { + "val": 55, + "widthType": "DXA", + }, + "right": Object { + "val": 55, + "widthType": "DXA", + }, + "top": Object { + "val": 0, + "widthType": "DXA", + }, + }, + "style": null, + "width": Object { + "width": 0, + "widthType": "Auto", + }, + }, + }, + Object { + "basedOn": null, + "name": "No List", + "paragraphProperty": Object { + "alignment": null, + "divId": null, + "indent": null, + "keepLines": false, + "keepNext": false, + "lineSpacing": null, + "numberingProperty": null, + "outlineLvl": null, + "pageBreakBefore": false, + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + "style": null, + "windowControl": false, + }, + "runProperty": Object { + "bold": null, + "boldCs": null, + "characterSpacing": null, + "color": null, + "del": null, + "fonts": null, + "highlight": null, + "ins": null, + "italic": null, + "italicCs": null, + "sz": null, + "szCs": null, + "textBorder": null, + "underline": null, + "vanish": null, + "vertAlign": null, + }, + "styleId": "a2", + "styleType": "numbering", + "tableCellProperty": Object { + "borders": null, + "gridSpan": null, + "shading": null, + "textDirection": null, + "verticalAlign": null, + "verticalMerge": null, + "width": null, + }, + "tableProperty": Object { + "borders": Object { + "bottom": Object { + "borderType": "single", + "color": "000000", + "position": "bottom", + "size": 2, + "space": 0, + }, + "insideH": Object { + "borderType": "single", + "color": "000000", + "position": "insideH", + "size": 2, + "space": 0, + }, + "insideV": Object { + "borderType": "single", + "color": "000000", + "position": "insideV", + "size": 2, + "space": 0, + }, + "left": Object { + "borderType": "single", + "color": "000000", + "position": "left", + "size": 2, + "space": 0, + }, + "right": Object { + "borderType": "single", + "color": "000000", + "position": "right", + "size": 2, + "space": 0, + }, + "top": Object { + "borderType": "single", + "color": "000000", + "position": "top", + "size": 2, + "space": 0, + }, + }, + "indent": null, + "justification": "left", + "layout": null, + "margins": Object { + "bottom": Object { + "val": 0, + "widthType": "DXA", + }, + "left": Object { + "val": 55, + "widthType": "DXA", + }, + "right": Object { + "val": 55, + "widthType": "DXA", + }, + "top": Object { + "val": 0, + "widthType": "DXA", + }, + }, + "style": null, + "width": Object { + "width": 0, + "widthType": "Auto", + }, + }, + }, + ], + }, + "taskpanes": null, + "taskpanesRels": Object { + "rels": Array [], + }, + "webExtensions": Array [], + "webSettings": Object { + "divs": Array [], + }, +} +`; + exports[`reader should read custom docx 1`] = ` Object { "comments": Object { @@ -15840,6 +17407,7 @@ Object { "keepNext": true, "lineSpacing": Object { "before": 200, + "beforeLines": 200, "line": 360, "lineRule": "Exact", }, @@ -15980,6 +17548,7 @@ Object { "keepNext": true, "lineSpacing": Object { "before": 100, + "beforeLines": 100, "line": 320, "lineRule": "Exact", }, @@ -22269,7 +23838,7 @@ exports[`writer should write line spacing 1`] = ` exports[`writer should write line spacing 2`] = ` " - Hello + Hello " `; diff --git a/docx-wasm/test/index.test.js b/docx-wasm/test/index.test.js index 7e6980c..75c04d3 100644 --- a/docx-wasm/test/index.test.js +++ b/docx-wasm/test/index.test.js @@ -74,6 +74,12 @@ describe("reader", () => { const json = w.readDocx(buffer); expect(json).toMatchSnapshot(); }); + + test("should read afterLines docx", () => { + const buffer = readFileSync("../fixtures/after_lines/after_lines.docx"); + const json = w.readDocx(buffer); + expect(json).toMatchSnapshot(); + }); }); describe("writer", () => { @@ -352,7 +358,9 @@ describe("writer", () => { test("should write line spacing", () => { const p = new w.Paragraph() .addRun(new w.Run().addText("Hello ")) - .lineSpacing(100, "", 100, 1); + .lineSpacing( + new w.LineSpacing().before(100).after(0).line(100).afterLines(400) + ); const buffer = new w.Docx().addParagraph(p).build(); writeFileSync("../output/line_spacing.docx", buffer); const z = new Zip(Buffer.from(buffer)); diff --git a/fixtures/after_lines/after_lines.docx b/fixtures/after_lines/after_lines.docx new file mode 100644 index 0000000..80e3cff Binary files /dev/null and b/fixtures/after_lines/after_lines.docx differ diff --git a/test.json b/test.json index 1a36ce5..45e72f9 100644 --- a/test.json +++ b/test.json @@ -14,7 +14,10 @@ "/word/numbering.xml": "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml", "/word/settings.xml": "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml", "/word/styles.xml": "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml" - } + }, + "web_extension_count": 1, + "custom_xml_count": 1, + "footer_count": 1 }, "rels": { "rels": [ @@ -43,7 +46,9 @@ "documentRels": { "hasComments": false, "hasNumberings": false, - "imageIds": [] + "imageIds": [], + "customXmlCount": 0, + "footerCount": 0 }, "docProps": { "app": {}, @@ -61,17 +66,15 @@ } }, "custom": { - "properties": { - "hello": "world" - } + "properties": {} } }, "styles": { "docDefaults": { "runPropertyDefault": { "runProperty": { - "sz": null, - "szCs": null, + "sz": 21, + "szCs": 21, "color": null, "highlight": null, "vertAlign": null, @@ -81,7 +84,7 @@ "italic": null, "italicCs": null, "vanish": null, - "spacing": null, + "characterSpacing": null, "fonts": null, "textBorder": null, "del": null, @@ -91,7 +94,7 @@ }, "styles": [ { - "styleId": "Normal", + "styleId": "a", "name": "Normal", "styleType": "paragraph", "runProperty": { @@ -106,7 +109,7 @@ "italic": null, "italicCs": null, "vanish": null, - "spacing": null, + "characterSpacing": null, "fonts": null, "textBorder": null, "del": null, @@ -125,7 +128,7 @@ "italic": null, "italicCs": null, "vanish": null, - "spacing": null, + "characterSpacing": null, "fonts": null, "textBorder": null, "del": null, @@ -133,13 +136,14 @@ }, "style": null, "numberingProperty": null, - "alignment": null, + "alignment": "both", "indent": null, - "lineHeight": null, + "lineSpacing": null, "keepNext": false, "keepLines": false, "pageBreakBefore": false, "windowControl": false, + "outlineLvl": null, "divId": null }, "tableProperty": { @@ -223,7 +227,379 @@ "textDirection": null, "shading": null }, - "basedOn": "Normal" + "basedOn": null + }, + { + "styleId": "a0", + "name": "Default Paragraph Font", + "styleType": "character", + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "paragraphProperty": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "style": null, + "numberingProperty": null, + "alignment": null, + "indent": null, + "lineSpacing": null, + "keepNext": false, + "keepLines": false, + "pageBreakBefore": false, + "windowControl": false, + "outlineLvl": null, + "divId": null + }, + "tableProperty": { + "width": { + "width": 0, + "widthType": "Auto" + }, + "justification": "left", + "borders": { + "top": { + "borderType": "single", + "size": 2, + "color": "000000", + "position": "top", + "space": 0 + }, + "left": { + "borderType": "single", + "size": 2, + "color": "000000", + "position": "left", + "space": 0 + }, + "bottom": { + "borderType": "single", + "size": 2, + "color": "000000", + "position": "bottom", + "space": 0 + }, + "right": { + "borderType": "single", + "size": 2, + "color": "000000", + "position": "right", + "space": 0 + }, + "insideH": { + "borderType": "single", + "size": 2, + "color": "000000", + "position": "insideH", + "space": 0 + }, + "insideV": { + "borderType": "single", + "size": 2, + "color": "000000", + "position": "insideV", + "space": 0 + } + }, + "margins": { + "top": { + "val": 0, + "widthType": "DXA" + }, + "left": { + "val": 55, + "widthType": "DXA" + }, + "bottom": { + "val": 0, + "widthType": "DXA" + }, + "right": { + "val": 55, + "widthType": "DXA" + } + }, + "indent": null, + "style": null, + "layout": null + }, + "tableCellProperty": { + "width": null, + "borders": null, + "gridSpan": null, + "verticalMerge": null, + "verticalAlign": null, + "textDirection": null, + "shading": null + }, + "basedOn": null + }, + { + "styleId": "a1", + "name": "Normal Table", + "styleType": "table", + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "paragraphProperty": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "style": null, + "numberingProperty": null, + "alignment": null, + "indent": null, + "lineSpacing": null, + "keepNext": false, + "keepLines": false, + "pageBreakBefore": false, + "windowControl": false, + "outlineLvl": null, + "divId": null + }, + "tableProperty": { + "width": { + "width": 0, + "widthType": "Auto" + }, + "justification": "left", + "borders": { + "top": null, + "left": null, + "bottom": null, + "right": null, + "insideH": null, + "insideV": null + }, + "margins": { + "top": { + "val": 0, + "widthType": "DXA" + }, + "left": { + "val": 55, + "widthType": "DXA" + }, + "bottom": { + "val": 0, + "widthType": "DXA" + }, + "right": { + "val": 55, + "widthType": "DXA" + } + }, + "indent": null, + "style": null, + "layout": null + }, + "tableCellProperty": { + "width": null, + "borders": null, + "gridSpan": null, + "verticalMerge": null, + "verticalAlign": null, + "textDirection": null, + "shading": null + }, + "basedOn": null + }, + { + "styleId": "a2", + "name": "No List", + "styleType": "numbering", + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "paragraphProperty": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "style": null, + "numberingProperty": null, + "alignment": null, + "indent": null, + "lineSpacing": null, + "keepNext": false, + "keepLines": false, + "pageBreakBefore": false, + "windowControl": false, + "outlineLvl": null, + "divId": null + }, + "tableProperty": { + "width": { + "width": 0, + "widthType": "Auto" + }, + "justification": "left", + "borders": { + "top": { + "borderType": "single", + "size": 2, + "color": "000000", + "position": "top", + "space": 0 + }, + "left": { + "borderType": "single", + "size": 2, + "color": "000000", + "position": "left", + "space": 0 + }, + "bottom": { + "borderType": "single", + "size": 2, + "color": "000000", + "position": "bottom", + "space": 0 + }, + "right": { + "borderType": "single", + "size": 2, + "color": "000000", + "position": "right", + "space": 0 + }, + "insideH": { + "borderType": "single", + "size": 2, + "color": "000000", + "position": "insideH", + "space": 0 + }, + "insideV": { + "borderType": "single", + "size": 2, + "color": "000000", + "position": "insideV", + "space": 0 + } + }, + "margins": { + "top": { + "val": 0, + "widthType": "DXA" + }, + "left": { + "val": 55, + "widthType": "DXA" + }, + "bottom": { + "val": 0, + "widthType": "DXA" + }, + "right": { + "val": 55, + "widthType": "DXA" + } + }, + "indent": null, + "style": null, + "layout": null + }, + "tableCellProperty": { + "width": null, + "borders": null, + "gridSpan": null, + "verticalMerge": null, + "verticalAlign": null, + "textDirection": null, + "shading": null + }, + "basedOn": null } ] }, @@ -232,7 +608,7 @@ { "type": "paragraph", "data": { - "id": "00000001", + "id": "78D5F6F5", "children": [ { "type": "run", @@ -249,7 +625,7 @@ "italic": null, "italicCs": null, "vanish": null, - "spacing": null, + "characterSpacing": null, "fonts": null, "textBorder": null, "del": null, @@ -260,7 +636,71 @@ "type": "text", "data": { "preserveSpace": true, - "text": "Hello" + "text": "第1条 " + } + } + ] + } + }, + { + "type": "run", + "data": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "children": [ + { + "type": "text", + "data": { + "preserveSpace": true, + "text": "ほげほげほげ" + } + } + ] + } + }, + { + "type": "run", + "data": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "children": [ + { + "type": "text", + "data": { + "preserveSpace": true, + "text": "ー" } } ] @@ -280,7 +720,7 @@ "italic": null, "italicCs": null, "vanish": null, - "spacing": null, + "characterSpacing": null, "fonts": null, "textBorder": null, "del": null, @@ -290,11 +730,767 @@ "numberingProperty": null, "alignment": null, "indent": null, - "lineHeight": null, + "lineSpacing": null, "keepNext": false, "keepLines": false, "pageBreakBefore": false, "windowControl": false, + "outlineLvl": null, + "divId": null + }, + "hasNumbering": false + } + }, + { + "type": "paragraph", + "data": { + "id": "47E607A1", + "children": [ + { + "type": "run", + "data": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "children": [ + { + "type": "text", + "data": { + "preserveSpace": true, + "text": "    こんにちは、こんにちは。" + } + } + ] + } + }, + { + "type": "run", + "data": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "children": [ + { + "type": "text", + "data": { + "preserveSpace": true, + "text": "Space after" + } + } + ] + } + } + ], + "property": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "style": null, + "numberingProperty": null, + "alignment": null, + "indent": null, + "lineSpacing": { + "after": 720 + }, + "keepNext": false, + "keepLines": false, + "pageBreakBefore": false, + "windowControl": false, + "outlineLvl": null, + "divId": null + }, + "hasNumbering": false + } + }, + { + "type": "paragraph", + "data": { + "id": "1D02E472", + "children": [ + { + "type": "run", + "data": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "children": [ + { + "type": "text", + "data": { + "preserveSpace": true, + "text": "第" + } + } + ] + } + }, + { + "type": "run", + "data": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "children": [ + { + "type": "text", + "data": { + "preserveSpace": true, + "text": "2" + } + } + ] + } + }, + { + "type": "run", + "data": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "children": [ + { + "type": "text", + "data": { + "preserveSpace": true, + "text": "条 " + } + } + ] + } + }, + { + "type": "run", + "data": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "children": [ + { + "type": "text", + "data": { + "preserveSpace": true, + "text": "ほげほげほげ" + } + } + ] + } + }, + { + "type": "run", + "data": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "children": [ + { + "type": "text", + "data": { + "preserveSpace": true, + "text": "ー" + } + } + ] + } + } + ], + "property": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "style": null, + "numberingProperty": null, + "alignment": null, + "indent": null, + "lineSpacing": null, + "keepNext": false, + "keepLines": false, + "pageBreakBefore": false, + "windowControl": false, + "outlineLvl": null, + "divId": null + }, + "hasNumbering": false + } + }, + { + "type": "paragraph", + "data": { + "id": "1302AFDA", + "children": [ + { + "type": "run", + "data": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "children": [ + { + "type": "text", + "data": { + "preserveSpace": true, + "text": "    こんにちは、こんにちは。" + } + } + ] + } + } + ], + "property": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "style": null, + "numberingProperty": null, + "alignment": null, + "indent": null, + "lineSpacing": null, + "keepNext": false, + "keepLines": false, + "pageBreakBefore": false, + "windowControl": false, + "outlineLvl": null, + "divId": null + }, + "hasNumbering": false + } + }, + { + "type": "paragraph", + "data": { + "id": "3C9869CF", + "children": [ + { + "type": "run", + "data": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "children": [ + { + "type": "text", + "data": { + "preserveSpace": true, + "text": "第" + } + } + ] + } + }, + { + "type": "run", + "data": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "children": [ + { + "type": "text", + "data": { + "preserveSpace": true, + "text": "3" + } + } + ] + } + }, + { + "type": "run", + "data": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "children": [ + { + "type": "text", + "data": { + "preserveSpace": true, + "text": "条 " + } + } + ] + } + }, + { + "type": "run", + "data": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "children": [ + { + "type": "text", + "data": { + "preserveSpace": true, + "text": "ほげほげほげ" + } + } + ] + } + }, + { + "type": "run", + "data": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "children": [ + { + "type": "text", + "data": { + "preserveSpace": true, + "text": "ー" + } + } + ] + } + } + ], + "property": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "style": null, + "numberingProperty": null, + "alignment": null, + "indent": null, + "lineSpacing": { + "before": 720 + }, + "keepNext": false, + "keepLines": false, + "pageBreakBefore": false, + "windowControl": false, + "outlineLvl": null, + "divId": null + }, + "hasNumbering": false + } + }, + { + "type": "paragraph", + "data": { + "id": "3E200AEF", + "children": [ + { + "type": "run", + "data": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "children": [ + { + "type": "text", + "data": { + "preserveSpace": true, + "text": "    こんにちは、こんにちは" + } + } + ] + } + }, + { + "type": "run", + "data": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "children": [ + { + "type": "text", + "data": { + "preserveSpace": true, + "text": "。" + } + } + ] + } + }, + { + "type": "run", + "data": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "children": [ + { + "type": "text", + "data": { + "preserveSpace": true, + "text": "Space before" + } + } + ] + } + } + ], + "property": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "style": null, + "numberingProperty": null, + "alignment": null, + "indent": null, + "lineSpacing": null, + "keepNext": false, + "keepLines": false, + "pageBreakBefore": false, + "windowControl": false, + "outlineLvl": null, + "divId": null + }, + "hasNumbering": false + } + }, + { + "type": "paragraph", + "data": { + "id": "4047C950", + "children": [], + "property": { + "runProperty": { + "sz": null, + "szCs": null, + "color": null, + "highlight": null, + "vertAlign": null, + "underline": null, + "bold": null, + "boldCs": null, + "italic": null, + "italicCs": null, + "vanish": null, + "characterSpacing": null, + "fonts": null, + "textBorder": null, + "del": null, + "ins": null + }, + "style": null, + "numberingProperty": null, + "alignment": null, + "indent": null, + "lineSpacing": null, + "keepNext": false, + "keepLines": false, + "pageBreakBefore": false, + "windowControl": false, + "outlineLvl": null, "divId": null }, "hasNumbering": false @@ -303,8 +1499,8 @@ ], "sectionProperty": { "pageSize": { - "w": 11906, - "h": 16838, + "w": 11900, + "h": 16840, "orient": null }, "pageMargin": { @@ -326,6 +1522,7 @@ "headerType": "default", "id": "rId4" }, + "footerReference": null, "sectionType": null }, "hasNumbering": false @@ -340,7 +1537,7 @@ "settings": { "defaultTabStop": 840, "zoom": 100, - "docId": null, + "docId": "FB0AE6E2-8FB8-3345-A8FC-78CE6F3ABE4E", "docVars": [] }, "fontTable": {}, @@ -348,10 +1545,19 @@ "header": { "children": [] }, + "footer": null, "commentsExtended": { "children": [] }, "webSettings": { "divs": [] - } + }, + "taskpanes": null, + "taskpanesRels": { + "rels": [] + }, + "webExtensions": [], + "customItems": [], + "customItemProps": [], + "customItemRels": [] } \ No newline at end of file