diff --git a/src/file/drawing/inline/doc-properties/doc-properties-attributes.ts b/src/file/drawing/inline/doc-properties/doc-properties-attributes.ts new file mode 100644 index 0000000000..ae75d35096 --- /dev/null +++ b/src/file/drawing/inline/doc-properties/doc-properties-attributes.ts @@ -0,0 +1,15 @@ +import { XmlAttributeComponent } from "file/xml-components"; + +export interface IDocPropertiesAttributes { + id?: number; + name?: string; + descr?: string; +} + +export class DocPropertiesAttributes extends XmlAttributeComponent { + protected xmlKeys = { + id: "id", + name: "name", + descr: "descr", + }; +} diff --git a/src/file/drawing/inline/doc-properties/doc-properties.ts b/src/file/drawing/inline/doc-properties/doc-properties.ts new file mode 100644 index 0000000000..b6e03d6953 --- /dev/null +++ b/src/file/drawing/inline/doc-properties/doc-properties.ts @@ -0,0 +1,15 @@ +import { XmlComponent } from "file/xml-components"; +import { DocPropertiesAttributes } from "./doc-properties-attributes"; + +export class DocProperties extends XmlComponent { + + constructor() { + super("wp:docPr"); + + this.root.push(new DocPropertiesAttributes({ + id: 0, + name: "", + descr: "", + })); + } +} diff --git a/src/file/drawing/inline/effect-extent/effect-extent-attributes.ts b/src/file/drawing/inline/effect-extent/effect-extent-attributes.ts new file mode 100644 index 0000000000..c97f4b123d --- /dev/null +++ b/src/file/drawing/inline/effect-extent/effect-extent-attributes.ts @@ -0,0 +1,17 @@ +import { XmlAttributeComponent } from "file/xml-components"; + +export interface IEffectExtentAttributes { + b?: number; + l?: number; + r?: number; + t?: number; +} + +export class EffectExtentAttributes extends XmlAttributeComponent { + protected xmlKeys = { + b: "b", + l: "l", + r: "r", + t: "t", + }; +} diff --git a/src/file/drawing/inline/effect-extent/effect-extent.ts b/src/file/drawing/inline/effect-extent/effect-extent.ts new file mode 100644 index 0000000000..97c6caa098 --- /dev/null +++ b/src/file/drawing/inline/effect-extent/effect-extent.ts @@ -0,0 +1,16 @@ +import { XmlComponent } from "file/xml-components"; +import { EffectExtentAttributes } from "./effect-extent-attributes"; + +export class EffectExtent extends XmlComponent { + + constructor() { + super("wp:effectExtent"); + + this.root.push(new EffectExtentAttributes({ + b: 0, + l: 0, + r: 0, + t: 0, + })); + } +} diff --git a/src/file/drawing/inline/extent/extent-attributes.ts b/src/file/drawing/inline/extent/extent-attributes.ts new file mode 100644 index 0000000000..89a02167f6 --- /dev/null +++ b/src/file/drawing/inline/extent/extent-attributes.ts @@ -0,0 +1,13 @@ +import { XmlAttributeComponent } from "file/xml-components"; + +export interface IExtentAttributes { + cx?: number; + cy?: number; +} + +export class ExtentAttributes extends XmlAttributeComponent { + protected xmlKeys = { + cx: "cx", + cy: "cy", + }; +} diff --git a/src/file/drawing/inline/extent/extent.ts b/src/file/drawing/inline/extent/extent.ts new file mode 100644 index 0000000000..13670d947e --- /dev/null +++ b/src/file/drawing/inline/extent/extent.ts @@ -0,0 +1,14 @@ +import { XmlComponent } from "file/xml-components"; +import { ExtentAttributes } from "./extent-attributes"; + +export class Extent extends XmlComponent { + + constructor() { + super("wp:extent"); + + this.root.push(new ExtentAttributes({ + cx: 3162300, + cy: 2857500, + })); + } +} diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/shape-properties.ts b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/shape-properties.ts index e5d5add2e1..38f9f2cbee 100644 --- a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/shape-properties.ts +++ b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/shape-properties.ts @@ -1,8 +1,8 @@ // http://officeopenxml.com/drwSp-SpPr.php import { XmlComponent } from "file/xml-components"; import { Form } from "./form"; -import { NoFill } from "./no-fill"; -import { Outline } from "./outline/outline"; +// import { NoFill } from "./no-fill"; +// import { Outline } from "./outline/outline"; import { PresetGeometry } from "./preset-geometry/preset-geometry"; import { ShapePropertiesAttributes } from "./shape-properties-attributes"; @@ -17,7 +17,7 @@ export class ShapeProperties extends XmlComponent { this.root.push(new Form()); this.root.push(new PresetGeometry()); - this.root.push(new NoFill()); - this.root.push(new Outline()); + // this.root.push(new NoFill()); + // this.root.push(new Outline()); } } diff --git a/src/file/drawing/inline/inline.ts b/src/file/drawing/inline/inline.ts index 42937fa251..bdf657ebc9 100644 --- a/src/file/drawing/inline/inline.ts +++ b/src/file/drawing/inline/inline.ts @@ -1,4 +1,8 @@ +// http://officeopenxml.com/drwPicInline.php import { XmlComponent } from "file/xml-components"; +import { DocProperties } from "./doc-properties/doc-properties"; +import { EffectExtent } from "./effect-extent/effect-extent"; +import { Extent } from "./extent/extent"; import { Graphic } from "./graphic"; import { GraphicFrameProperties } from "./graphic-frame/graphic-frame-properties"; import { InlineAttributes } from "./inline-attributes"; @@ -15,6 +19,9 @@ export class Inline extends XmlComponent { distR: 0, })); + this.root.push(new Extent()); + this.root.push(new EffectExtent()); + this.root.push(new DocProperties()); this.root.push(new GraphicFrameProperties()); this.root.push(new Graphic(referenceId)); }