@ -10,13 +10,7 @@ paragraph.addRun(dateText);
|
|||||||
|
|
||||||
doc.addParagraph(paragraph);
|
doc.addParagraph(paragraph);
|
||||||
|
|
||||||
// Feature coming soon
|
|
||||||
// var media = new docx.Media();
|
|
||||||
// media.addMedia("happy-penguins", "./demo/penguins.jpg");
|
|
||||||
// var pictureRun = new docx.PictureRun(media.getMedia("happy-penguins"));
|
|
||||||
|
|
||||||
// var exporter = new docx.LocalPacker(doc);
|
|
||||||
var exporter = new docx.LocalPacker(doc);
|
var exporter = new docx.LocalPacker(doc);
|
||||||
exporter.pack('My Document');
|
exporter.pack('My Document');
|
||||||
|
|
||||||
console.log('Document created succesfully at project root!');
|
console.log('Document created succesfully at project root!');
|
||||||
|
17
demo/demo5.js
Normal file
17
demo/demo5.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
const docx = require('../build');
|
||||||
|
|
||||||
|
var doc = new docx.File();
|
||||||
|
|
||||||
|
var paragraph = new docx.Paragraph("Hello World");
|
||||||
|
doc.addParagraph(paragraph);
|
||||||
|
|
||||||
|
const image = doc.createImage("./demo/images/image1.jpeg");
|
||||||
|
const image2 = doc.createImage("./demo/images/dog.png");
|
||||||
|
const image3 = doc.createImage("./demo/images/cat.jpg");
|
||||||
|
const image4 = doc.createImage("./demo/images/parrots.bmp");
|
||||||
|
const image5 = doc.createImage("./demo/images/pizza.gif");
|
||||||
|
|
||||||
|
var exporter = new docx.LocalPacker(doc);
|
||||||
|
exporter.pack('My Document');
|
||||||
|
|
||||||
|
console.log('Document created successfully at project root!');
|
BIN
demo/images/cat.jpg
Normal file
BIN
demo/images/cat.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 154 KiB |
BIN
demo/images/dog.png
Normal file
BIN
demo/images/dog.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 190 KiB |
Before Width: | Height: | Size: 162 KiB After Width: | Height: | Size: 162 KiB |
BIN
demo/images/parrots.bmp
Normal file
BIN
demo/images/parrots.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 818 KiB |
BIN
demo/images/pizza.gif
Normal file
BIN
demo/images/pizza.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 310 KiB |
@ -39,9 +39,11 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/archiver": "^1.3.4",
|
"@types/archiver": "^1.3.4",
|
||||||
"@types/express": "^4.0.35",
|
"@types/express": "^4.0.35",
|
||||||
|
"@types/image-size": "0.0.29",
|
||||||
"@types/request": "^2.0.3",
|
"@types/request": "^2.0.3",
|
||||||
"@types/request-promise": "^4.1.39",
|
"@types/request-promise": "^4.1.39",
|
||||||
"archiver": "^1.3.0",
|
"archiver": "^1.3.0",
|
||||||
|
"image-size": "^0.6.2",
|
||||||
"request": "^2.83.0",
|
"request": "^2.83.0",
|
||||||
"request-promise": "^4.2.2",
|
"request-promise": "^4.2.2",
|
||||||
"xml": "^1.0.1"
|
"xml": "^1.0.1"
|
||||||
|
@ -32,7 +32,7 @@ export class Compiler {
|
|||||||
cwd: TEMPLATE_PATH,
|
cwd: TEMPLATE_PATH,
|
||||||
});
|
});
|
||||||
|
|
||||||
const xmlDocument = xml(this.formatter.format(this.file.Document));
|
const xmlDocument = xml(this.formatter.format(this.file.Document), true);
|
||||||
const xmlStyles = xml(this.formatter.format(this.file.Styles));
|
const xmlStyles = xml(this.formatter.format(this.file.Styles));
|
||||||
const xmlProperties = xml(this.formatter.format(this.file.Properties), {
|
const xmlProperties = xml(this.formatter.format(this.file.Properties), {
|
||||||
declaration: {
|
declaration: {
|
||||||
@ -41,6 +41,7 @@ export class Compiler {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
const xmlNumbering = xml(this.formatter.format(this.file.Numbering));
|
const xmlNumbering = xml(this.formatter.format(this.file.Numbering));
|
||||||
|
const xmlRelationships = xml(this.formatter.format(this.file.Relationships));
|
||||||
|
|
||||||
this.archive.append(xmlDocument, {
|
this.archive.append(xmlDocument, {
|
||||||
name: "word/document.xml",
|
name: "word/document.xml",
|
||||||
@ -58,9 +59,13 @@ export class Compiler {
|
|||||||
name: "word/numbering.xml",
|
name: "word/numbering.xml",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.archive.append(xmlRelationships, {
|
||||||
|
name: "word/_rels/document.xml.rels",
|
||||||
|
});
|
||||||
|
|
||||||
for (const data of this.file.Media.array) {
|
for (const data of this.file.Media.array) {
|
||||||
this.archive.append(data.stream, {
|
this.archive.append(data.stream, {
|
||||||
name: `media/${data.fileName}`,
|
name: `word/media/${data.fileName}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// http://officeopenxml.com/WPdocument.php
|
// http://officeopenxml.com/WPdocument.php
|
||||||
|
import { IMediaData } from "file/media";
|
||||||
import { XmlComponent } from "file/xml-components";
|
import { XmlComponent } from "file/xml-components";
|
||||||
import { Paragraph } from "../paragraph";
|
import { Paragraph, PictureRun } from "../paragraph";
|
||||||
import { Table } from "../table";
|
import { Table } from "../table";
|
||||||
import { Body } from "./body";
|
import { Body } from "./body";
|
||||||
import { DocumentAttributes } from "./document-attributes";
|
import { DocumentAttributes } from "./document-attributes";
|
||||||
@ -52,4 +53,18 @@ export class Document extends XmlComponent {
|
|||||||
this.addTable(table);
|
this.addTable(table);
|
||||||
return table;
|
return table;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public addDrawing(imageData: IMediaData): void {
|
||||||
|
const paragraph = new Paragraph();
|
||||||
|
const run = new PictureRun(imageData);
|
||||||
|
paragraph.addRun(run);
|
||||||
|
|
||||||
|
this.body.push(paragraph);
|
||||||
|
}
|
||||||
|
|
||||||
|
public createDrawing(imageData: IMediaData): void {
|
||||||
|
this.addDrawing(imageData);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,12 +8,22 @@ describe("Drawing", () => {
|
|||||||
let currentBreak: Drawing;
|
let currentBreak: Drawing;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
const path = "./demo/penguins.jpg";
|
const path = "./demo/images/image1.jpeg";
|
||||||
currentBreak = new Drawing({
|
currentBreak = new Drawing({
|
||||||
fileName: "test.jpg",
|
fileName: "test.jpg",
|
||||||
referenceId: 1,
|
referenceId: 1,
|
||||||
stream: fs.createReadStream(path),
|
stream: fs.createReadStream(path),
|
||||||
path: path,
|
path: path,
|
||||||
|
dimensions: {
|
||||||
|
pixels: {
|
||||||
|
x: 100,
|
||||||
|
y: 100,
|
||||||
|
},
|
||||||
|
emus: {
|
||||||
|
x: 100 * 9525,
|
||||||
|
y: 100 * 9525,
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
16
src/file/drawing/drawing.ts
Normal file
16
src/file/drawing/drawing.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { IMediaData } from "file/media";
|
||||||
|
import { XmlComponent } from "file/xml-components";
|
||||||
|
import { Inline } from "./inline";
|
||||||
|
|
||||||
|
export class Drawing extends XmlComponent {
|
||||||
|
|
||||||
|
constructor(imageData: IMediaData) {
|
||||||
|
super("w:drawing");
|
||||||
|
|
||||||
|
if (imageData === undefined) {
|
||||||
|
throw new Error("imageData cannot be undefined");
|
||||||
|
}
|
||||||
|
|
||||||
|
this.root.push(new Inline(imageData.referenceId, imageData.dimensions));
|
||||||
|
}
|
||||||
|
}
|
@ -1,16 +1 @@
|
|||||||
import { IData } from "file/media";
|
export { Drawing } from "./drawing";
|
||||||
import { XmlComponent } from "file/xml-components";
|
|
||||||
import { Inline } from "./inline";
|
|
||||||
|
|
||||||
export class Drawing extends XmlComponent {
|
|
||||||
|
|
||||||
constructor(imageData: IData) {
|
|
||||||
super("w:drawing");
|
|
||||||
|
|
||||||
if (imageData === undefined) {
|
|
||||||
throw new Error("imageData cannot be undefined");
|
|
||||||
}
|
|
||||||
|
|
||||||
this.root.push(new Inline(imageData.referenceId));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
import { XmlAttributeComponent } from "file/xml-components";
|
||||||
|
|
||||||
|
export interface IDocPropertiesAttributes {
|
||||||
|
id?: number;
|
||||||
|
name?: string;
|
||||||
|
descr?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class DocPropertiesAttributes extends XmlAttributeComponent<IDocPropertiesAttributes> {
|
||||||
|
protected xmlKeys = {
|
||||||
|
id: "id",
|
||||||
|
name: "name",
|
||||||
|
descr: "descr",
|
||||||
|
};
|
||||||
|
}
|
15
src/file/drawing/inline/doc-properties/doc-properties.ts
Normal file
15
src/file/drawing/inline/doc-properties/doc-properties.ts
Normal file
@ -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: "",
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
@ -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<IEffectExtentAttributes> {
|
||||||
|
protected xmlKeys = {
|
||||||
|
b: "b",
|
||||||
|
l: "l",
|
||||||
|
r: "r",
|
||||||
|
t: "t",
|
||||||
|
};
|
||||||
|
}
|
16
src/file/drawing/inline/effect-extent/effect-extent.ts
Normal file
16
src/file/drawing/inline/effect-extent/effect-extent.ts
Normal file
@ -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,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
13
src/file/drawing/inline/extent/extent-attributes.ts
Normal file
13
src/file/drawing/inline/extent/extent-attributes.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { XmlAttributeComponent } from "file/xml-components";
|
||||||
|
|
||||||
|
export interface IExtentAttributes {
|
||||||
|
cx?: number;
|
||||||
|
cy?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ExtentAttributes extends XmlAttributeComponent<IExtentAttributes> {
|
||||||
|
protected xmlKeys = {
|
||||||
|
cx: "cx",
|
||||||
|
cy: "cy",
|
||||||
|
};
|
||||||
|
}
|
14
src/file/drawing/inline/extent/extent.ts
Normal file
14
src/file/drawing/inline/extent/extent.ts
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import { XmlComponent } from "file/xml-components";
|
||||||
|
import { ExtentAttributes } from "./extent-attributes";
|
||||||
|
|
||||||
|
export class Extent extends XmlComponent {
|
||||||
|
|
||||||
|
constructor(x: number, y: number) {
|
||||||
|
super("wp:extent");
|
||||||
|
|
||||||
|
this.root.push(new ExtentAttributes({
|
||||||
|
cx: x,
|
||||||
|
cy: y,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
import { XmlAttributeComponent } from "file/xml-components";
|
||||||
|
|
||||||
|
export interface IGraphicFrameLockAttributes {
|
||||||
|
xmlns?: string;
|
||||||
|
noChangeAspect?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class GraphicFrameLockAttributes extends XmlAttributeComponent<IGraphicFrameLockAttributes> {
|
||||||
|
protected xmlKeys = {
|
||||||
|
xmlns: "xmlns:a",
|
||||||
|
noChangeAspect: "noChangeAspect",
|
||||||
|
};
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
import { XmlComponent } from "file/xml-components";
|
||||||
|
import { GraphicFrameLockAttributes } from "./graphic-frame-lock-attributes";
|
||||||
|
|
||||||
|
export class GraphicFrameLocks extends XmlComponent {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super("a:graphicFrameLocks");
|
||||||
|
|
||||||
|
this.root.push(new GraphicFrameLockAttributes({
|
||||||
|
xmlns: "http://schemas.openxmlformats.org/drawingml/2006/main",
|
||||||
|
noChangeAspect: 1,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
import { XmlComponent } from "file/xml-components";
|
||||||
|
import { GraphicFrameLocks } from "./graphic-frame-locks/graphic-frame-locks";
|
||||||
|
|
||||||
|
export class GraphicFrameProperties extends XmlComponent {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super("wp:cNvGraphicFramePr");
|
||||||
|
|
||||||
|
this.root.push(new GraphicFrameLocks());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
import { XmlAttributeComponent } from "file/xml-components";
|
||||||
|
|
||||||
|
export interface IGraphicDataAttributes {
|
||||||
|
uri?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class GraphicDataAttributes extends XmlAttributeComponent<IGraphicDataAttributes> {
|
||||||
|
protected xmlKeys = {
|
||||||
|
uri: "uri",
|
||||||
|
};
|
||||||
|
}
|
16
src/file/drawing/inline/graphic/graphic-data/graphic-data.ts
Normal file
16
src/file/drawing/inline/graphic/graphic-data/graphic-data.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { XmlComponent } from "file/xml-components";
|
||||||
|
import { GraphicDataAttributes } from "./graphic-data-attribute";
|
||||||
|
import { Pic } from "./pic";
|
||||||
|
|
||||||
|
export class GraphicData extends XmlComponent {
|
||||||
|
|
||||||
|
constructor(referenceId: number, x: number, y: number) {
|
||||||
|
super("a:graphicData");
|
||||||
|
|
||||||
|
this.root.push(new GraphicDataAttributes({
|
||||||
|
uri: "http://schemas.openxmlformats.org/drawingml/2006/picture",
|
||||||
|
}));
|
||||||
|
|
||||||
|
this.root.push(new Pic(referenceId, x, y));
|
||||||
|
}
|
||||||
|
}
|
@ -1,10 +1 @@
|
|||||||
import { XmlComponent } from "file/xml-components";
|
export * from "./graphic-data";
|
||||||
import { Pic } from "./pic";
|
|
||||||
|
|
||||||
export class GraphicData extends XmlComponent {
|
|
||||||
|
|
||||||
constructor(referenceId: number) {
|
|
||||||
super("a:graphicData");
|
|
||||||
this.root.push(new Pic(referenceId));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -2,11 +2,13 @@ import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
|||||||
|
|
||||||
interface IBlipProperties {
|
interface IBlipProperties {
|
||||||
embed: string;
|
embed: string;
|
||||||
|
cstate: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
class BlipAttributes extends XmlAttributeComponent<IBlipProperties> {
|
class BlipAttributes extends XmlAttributeComponent<IBlipProperties> {
|
||||||
protected xmlKeys = {
|
protected xmlKeys = {
|
||||||
embed: "r:embed",
|
embed: "r:embed",
|
||||||
|
cstate: "cstate",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16,6 +18,7 @@ export class Blip extends XmlComponent {
|
|||||||
super("a:blip");
|
super("a:blip");
|
||||||
this.root.push(new BlipAttributes({
|
this.root.push(new BlipAttributes({
|
||||||
embed: `rId${referenceId}`,
|
embed: `rId${referenceId}`,
|
||||||
|
cstate: "none",
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1 @@
|
|||||||
import { XmlComponent } from "file/xml-components";
|
export * from "./pic";
|
||||||
import { BlipFill } from "./blip/blip-fill";
|
|
||||||
|
|
||||||
export class Pic extends XmlComponent {
|
|
||||||
|
|
||||||
constructor(referenceId: number) {
|
|
||||||
super("pic:pic");
|
|
||||||
this.root.push(new BlipFill(referenceId));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
import { XmlComponent } from "file/xml-components";
|
||||||
|
import { PicLocks } from "./pic-locks/pic-locks";
|
||||||
|
|
||||||
|
export class ChildNonVisualProperties extends XmlComponent {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super("pic:cNvPicPr");
|
||||||
|
|
||||||
|
this.root.push(new PicLocks());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
import { XmlAttributeComponent } from "file/xml-components";
|
||||||
|
|
||||||
|
export interface IPicLocksAttributes {
|
||||||
|
noChangeAspect?: number;
|
||||||
|
noChangeArrowheads?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class PicLocksAttributes extends XmlAttributeComponent<IPicLocksAttributes> {
|
||||||
|
protected xmlKeys = {
|
||||||
|
noChangeAspect: "noChangeAspect",
|
||||||
|
noChangeArrowheads: "noChangeArrowheads",
|
||||||
|
};
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
import { XmlComponent } from "file/xml-components";
|
||||||
|
import { PicLocksAttributes } from "./pic-locks-attributes";
|
||||||
|
|
||||||
|
export class PicLocks extends XmlComponent {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super("a:picLocks");
|
||||||
|
this.root.push(new PicLocksAttributes({
|
||||||
|
noChangeAspect: 1,
|
||||||
|
noChangeArrowheads: 1,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
import { XmlComponent } from "file/xml-components";
|
||||||
|
import { ChildNonVisualProperties } from "./child-non-visual-pic-properties/child-non-visual-pic-properties";
|
||||||
|
import { NonVisualProperties } from "./non-visual-properties/non-visual-properties";
|
||||||
|
|
||||||
|
export class NonVisualPicProperties extends XmlComponent {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super("pic:nvPicPr");
|
||||||
|
|
||||||
|
this.root.push(new NonVisualProperties());
|
||||||
|
this.root.push(new ChildNonVisualProperties());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
import { XmlAttributeComponent } from "file/xml-components";
|
||||||
|
|
||||||
|
export interface INonVisualPropertiesAttributes {
|
||||||
|
id?: number;
|
||||||
|
name?: string;
|
||||||
|
descr?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class NonVisualPropertiesAttributes extends XmlAttributeComponent<INonVisualPropertiesAttributes> {
|
||||||
|
protected xmlKeys = {
|
||||||
|
id: "id",
|
||||||
|
name: "name",
|
||||||
|
descr: "desc",
|
||||||
|
};
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
import { XmlComponent } from "file/xml-components";
|
||||||
|
import { NonVisualPropertiesAttributes } from "./non-visual-properties-attributes";
|
||||||
|
|
||||||
|
export class NonVisualProperties extends XmlComponent {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super("pic:cNvPr");
|
||||||
|
|
||||||
|
this.root.push(new NonVisualPropertiesAttributes({
|
||||||
|
id: 0,
|
||||||
|
name: "",
|
||||||
|
descr: "",
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
import { XmlAttributeComponent } from "file/xml-components";
|
||||||
|
|
||||||
|
export interface IPicAttributes {
|
||||||
|
xmlns?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class PicAttributes extends XmlAttributeComponent<IPicAttributes> {
|
||||||
|
protected xmlKeys = {
|
||||||
|
xmlns: "xmlns:pic",
|
||||||
|
};
|
||||||
|
}
|
19
src/file/drawing/inline/graphic/graphic-data/pic/pic.ts
Normal file
19
src/file/drawing/inline/graphic/graphic-data/pic/pic.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// http://officeopenxml.com/drwPic.php
|
||||||
|
import { XmlComponent } from "file/xml-components";
|
||||||
|
import { BlipFill } from "./blip/blip-fill";
|
||||||
|
import { NonVisualPicProperties } from "./non-visual-pic-properties/non-visual-pic-properties";
|
||||||
|
import { PicAttributes } from "./pic-attributes";
|
||||||
|
import { ShapeProperties } from "./shape-properties/shape-properties";
|
||||||
|
|
||||||
|
export class Pic extends XmlComponent {
|
||||||
|
constructor(referenceId: number, x: number, y: number) {
|
||||||
|
super("pic:pic");
|
||||||
|
|
||||||
|
this.root.push(new PicAttributes({
|
||||||
|
xmlns: "http://schemas.openxmlformats.org/drawingml/2006/picture",
|
||||||
|
}));
|
||||||
|
this.root.push(new NonVisualPicProperties());
|
||||||
|
this.root.push(new BlipFill(referenceId));
|
||||||
|
this.root.push(new ShapeProperties(x, y));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
import { XmlAttributeComponent } from "file/xml-components";
|
||||||
|
|
||||||
|
export interface IExtentsAttributes {
|
||||||
|
cx?: number;
|
||||||
|
cy?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ExtentsAttributes extends XmlAttributeComponent<IExtentsAttributes> {
|
||||||
|
protected xmlKeys = {
|
||||||
|
cx: "cx",
|
||||||
|
cy: "cy",
|
||||||
|
};
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
// http://officeopenxml.com/drwSp-size.php
|
||||||
|
import { XmlComponent } from "file/xml-components";
|
||||||
|
import { ExtentsAttributes } from "./extents-attributes";
|
||||||
|
|
||||||
|
export class Extents extends XmlComponent {
|
||||||
|
|
||||||
|
constructor(x: number, y: number) {
|
||||||
|
super("a:ext");
|
||||||
|
|
||||||
|
this.root.push(new ExtentsAttributes({
|
||||||
|
cx: x,
|
||||||
|
cy: y,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
// http://officeopenxml.com/drwSp-size.php
|
||||||
|
import { XmlComponent } from "file/xml-components";
|
||||||
|
import { Extents } from "./extents/extents";
|
||||||
|
import { Offset } from "./offset/off";
|
||||||
|
|
||||||
|
export class Form extends XmlComponent {
|
||||||
|
|
||||||
|
constructor(x: number, y: number) {
|
||||||
|
super("a:xfrm");
|
||||||
|
|
||||||
|
this.root.push(new Extents(x, y));
|
||||||
|
this.root.push(new Offset());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
export * from "./form";
|
@ -0,0 +1,13 @@
|
|||||||
|
import { XmlAttributeComponent } from "file/xml-components";
|
||||||
|
|
||||||
|
export interface IOffsetAttributes {
|
||||||
|
x?: number;
|
||||||
|
y?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class OffsetAttributes extends XmlAttributeComponent<IOffsetAttributes> {
|
||||||
|
protected xmlKeys = {
|
||||||
|
x: "x",
|
||||||
|
y: "y",
|
||||||
|
};
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
// http://officeopenxml.com/drwSp-size.php
|
||||||
|
import { XmlComponent } from "file/xml-components";
|
||||||
|
import { OffsetAttributes } from "./off-attributes";
|
||||||
|
|
||||||
|
export class Offset extends XmlComponent {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super("a:off");
|
||||||
|
|
||||||
|
this.root.push(new OffsetAttributes({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
import { XmlComponent } from "file/xml-components";
|
||||||
|
|
||||||
|
export class NoFill extends XmlComponent {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super("a:noFill");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
import { XmlComponent } from "file/xml-components";
|
||||||
|
|
||||||
|
export class NoFill extends XmlComponent {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super("a:noFill");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
// http://officeopenxml.com/drwSp-outline.php
|
||||||
|
import { XmlComponent } from "file/xml-components";
|
||||||
|
import { NoFill } from "./no-fill";
|
||||||
|
|
||||||
|
export class Outline extends XmlComponent {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super("a:ln");
|
||||||
|
|
||||||
|
this.root.push(new NoFill());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
// http://officeopenxml.com/drwSp-prstGeom.php
|
||||||
|
import { XmlComponent } from "file/xml-components";
|
||||||
|
|
||||||
|
export class AdjustmentValues extends XmlComponent {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super("a:avLst");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
import { XmlAttributeComponent } from "file/xml-components";
|
||||||
|
|
||||||
|
export interface IPresetGeometryAttributes {
|
||||||
|
prst?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class PresetGeometryAttributes extends XmlAttributeComponent<IPresetGeometryAttributes> {
|
||||||
|
protected xmlKeys = {
|
||||||
|
prst: "prst",
|
||||||
|
};
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
// http://officeopenxml.com/drwSp-prstGeom.php
|
||||||
|
import { XmlComponent } from "file/xml-components";
|
||||||
|
import { AdjustmentValues } from "./adjustment-values/adjustment-values";
|
||||||
|
import { PresetGeometryAttributes } from "./preset-geometry-attributes";
|
||||||
|
|
||||||
|
export class PresetGeometry extends XmlComponent {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super("a:prstGeom");
|
||||||
|
|
||||||
|
this.root.push(new PresetGeometryAttributes({
|
||||||
|
prst: "rect",
|
||||||
|
}));
|
||||||
|
|
||||||
|
this.root.push(new AdjustmentValues());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
import { XmlAttributeComponent } from "file/xml-components";
|
||||||
|
|
||||||
|
export interface IShapePropertiesAttributes {
|
||||||
|
bwMode?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ShapePropertiesAttributes extends XmlAttributeComponent<IShapePropertiesAttributes> {
|
||||||
|
protected xmlKeys = {
|
||||||
|
bwMode: "bwMode",
|
||||||
|
};
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
// 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 { PresetGeometry } from "./preset-geometry/preset-geometry";
|
||||||
|
import { ShapePropertiesAttributes } from "./shape-properties-attributes";
|
||||||
|
|
||||||
|
export class ShapeProperties extends XmlComponent {
|
||||||
|
|
||||||
|
constructor(x: number, y: number) {
|
||||||
|
super("pic:spPr");
|
||||||
|
|
||||||
|
this.root.push(new ShapePropertiesAttributes({
|
||||||
|
bwMode: "auto",
|
||||||
|
}));
|
||||||
|
|
||||||
|
this.root.push(new Form(x, y));
|
||||||
|
this.root.push(new PresetGeometry());
|
||||||
|
// this.root.push(new NoFill());
|
||||||
|
// this.root.push(new Outline());
|
||||||
|
}
|
||||||
|
}
|
@ -13,11 +13,11 @@ class GraphicAttributes extends XmlAttributeComponent<IGraphicProperties> {
|
|||||||
|
|
||||||
export class Graphic extends XmlComponent {
|
export class Graphic extends XmlComponent {
|
||||||
|
|
||||||
constructor(referenceId: number) {
|
constructor(referenceId: number, x: number, y: number) {
|
||||||
super("a:graphic");
|
super("a:graphic");
|
||||||
this.root.push(new GraphicAttributes({
|
this.root.push(new GraphicAttributes({
|
||||||
a: "http://schemas.openxmlformats.org/drawingml/2006/main",
|
a: "http://schemas.openxmlformats.org/drawingml/2006/main",
|
||||||
}));
|
}));
|
||||||
this.root.push(new GraphicData(referenceId));
|
this.root.push(new GraphicData(referenceId, x, y));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1 @@
|
|||||||
import { XmlComponent } from "file/xml-components";
|
export * from "./inline";
|
||||||
import { Graphic } from "./graphic";
|
|
||||||
|
|
||||||
export class Inline extends XmlComponent {
|
|
||||||
|
|
||||||
constructor(referenceId: number) {
|
|
||||||
super("wp:inline");
|
|
||||||
this.root.push(new Graphic(referenceId));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
17
src/file/drawing/inline/inline-attributes.ts
Normal file
17
src/file/drawing/inline/inline-attributes.ts
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import { XmlAttributeComponent } from "file/xml-components";
|
||||||
|
|
||||||
|
export interface IInlineAttributes {
|
||||||
|
distT?: number;
|
||||||
|
distB?: number;
|
||||||
|
distL?: number;
|
||||||
|
distR?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class InlineAttributes extends XmlAttributeComponent<IInlineAttributes> {
|
||||||
|
protected xmlKeys = {
|
||||||
|
distT: "distT",
|
||||||
|
distB: "distB",
|
||||||
|
distL: "distL",
|
||||||
|
distR: "distR",
|
||||||
|
};
|
||||||
|
}
|
29
src/file/drawing/inline/inline.ts
Normal file
29
src/file/drawing/inline/inline.ts
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
// http://officeopenxml.com/drwPicInline.php
|
||||||
|
import { IMediaDataDimensions } from "file/media";
|
||||||
|
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";
|
||||||
|
|
||||||
|
export class Inline extends XmlComponent {
|
||||||
|
|
||||||
|
constructor(referenceId: number, dimensions: IMediaDataDimensions) {
|
||||||
|
super("wp:inline");
|
||||||
|
|
||||||
|
this.root.push(new InlineAttributes({
|
||||||
|
distT: 0,
|
||||||
|
distB: 0,
|
||||||
|
distL: 0,
|
||||||
|
distR: 0,
|
||||||
|
}));
|
||||||
|
|
||||||
|
this.root.push(new Extent(dimensions.emus.x, dimensions.emus.y));
|
||||||
|
this.root.push(new EffectExtent());
|
||||||
|
this.root.push(new DocProperties());
|
||||||
|
this.root.push(new GraphicFrameProperties());
|
||||||
|
this.root.push(new Graphic(referenceId, dimensions.emus.x, dimensions.emus.y));
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +1,4 @@
|
|||||||
|
import { Relationships } from "file/relationships";
|
||||||
import { Document } from "./document";
|
import { Document } from "./document";
|
||||||
import { Media } from "./media";
|
import { Media } from "./media";
|
||||||
import { Numbering } from "./numbering";
|
import { Numbering } from "./numbering";
|
||||||
@ -14,6 +15,7 @@ export class File {
|
|||||||
private properties: Properties;
|
private properties: Properties;
|
||||||
private numbering: Numbering;
|
private numbering: Numbering;
|
||||||
private media: Media;
|
private media: Media;
|
||||||
|
private relationships: Relationships;
|
||||||
|
|
||||||
constructor(options?: IPropertiesOptions) {
|
constructor(options?: IPropertiesOptions) {
|
||||||
this.document = new Document();
|
this.document = new Document();
|
||||||
@ -31,6 +33,7 @@ export class File {
|
|||||||
this.properties = new Properties(options);
|
this.properties = new Properties(options);
|
||||||
this.numbering = new Numbering();
|
this.numbering = new Numbering();
|
||||||
this.media = new Media();
|
this.media = new Media();
|
||||||
|
this.relationships = new Relationships();
|
||||||
}
|
}
|
||||||
|
|
||||||
public addParagraph(paragraph: Paragraph): void {
|
public addParagraph(paragraph: Paragraph): void {
|
||||||
@ -49,6 +52,12 @@ export class File {
|
|||||||
return this.document.createTable(rows, cols);
|
return this.document.createTable(rows, cols);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public createImage(image: string): void {
|
||||||
|
const mediaData = this.media.addMedia(image);
|
||||||
|
this.relationships.createRelationship(mediaData.referenceId, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", `media/${mediaData.fileName}`);
|
||||||
|
this.document.createDrawing(mediaData);
|
||||||
|
}
|
||||||
|
|
||||||
public get Document(): Document {
|
public get Document(): Document {
|
||||||
return this.document;
|
return this.document;
|
||||||
}
|
}
|
||||||
@ -68,4 +77,8 @@ export class File {
|
|||||||
public get Media(): Media {
|
public get Media(): Media {
|
||||||
return this.media;
|
return this.media;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get Relationships(): Relationships {
|
||||||
|
return this.relationships;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,20 @@
|
|||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
|
|
||||||
export interface IData {
|
export interface IMediaDataDimensions {
|
||||||
|
pixels: {
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
};
|
||||||
|
emus: {
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IMediaData {
|
||||||
referenceId: number;
|
referenceId: number;
|
||||||
stream: fs.ReadStream;
|
stream: fs.ReadStream;
|
||||||
path: string;
|
path: string;
|
||||||
fileName: string;
|
fileName: string;
|
||||||
|
dimensions: IMediaDataDimensions;
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,17 @@
|
|||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
|
import * as sizeOf from "image-size";
|
||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
import { IData } from "./data";
|
|
||||||
|
import {IMediaData} from "./data";
|
||||||
|
|
||||||
export class Media {
|
export class Media {
|
||||||
private map: Map<string, IData>;
|
private map: Map<string, IMediaData>;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.map = new Map<string, IData>();
|
this.map = new Map<string, IMediaData>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public getMedia(key: string): IData {
|
public getMedia(key: string): IMediaData {
|
||||||
const data = this.map.get(key);
|
const data = this.map.get(key);
|
||||||
|
|
||||||
if (data === undefined) {
|
if (data === undefined) {
|
||||||
@ -19,17 +21,33 @@ export class Media {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public addMedia(key: string, filePath: string): void {
|
public addMedia(filePath: string): IMediaData {
|
||||||
this.map.set(key, {
|
const key = path.basename(filePath);
|
||||||
referenceId: this.map.values.length,
|
const dimensions = sizeOf(filePath);
|
||||||
|
|
||||||
|
const imageData = {
|
||||||
|
referenceId: this.map.size + 3,
|
||||||
stream: fs.createReadStream(filePath),
|
stream: fs.createReadStream(filePath),
|
||||||
path: filePath,
|
path: filePath,
|
||||||
fileName: path.basename(filePath),
|
fileName: key,
|
||||||
});
|
dimensions: {
|
||||||
|
pixels: {
|
||||||
|
x: dimensions.width,
|
||||||
|
y: dimensions.height,
|
||||||
|
},
|
||||||
|
emus: {
|
||||||
|
x: dimensions.width * 9525,
|
||||||
|
y: dimensions.height * 9525,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
this.map.set(key, imageData);
|
||||||
|
|
||||||
|
return imageData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get array(): IData[] {
|
public get array(): IMediaData[] {
|
||||||
const array = new Array<IData>();
|
const array = new Array<IMediaData>();
|
||||||
|
|
||||||
this.map.forEach((data) => {
|
this.map.forEach((data) => {
|
||||||
array.push(data);
|
array.push(data);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// http://officeopenxml.com/WPparagraph.php
|
// http://officeopenxml.com/WPparagraph.php
|
||||||
import { IData } from "file/media";
|
import { IMediaData } from "file/media";
|
||||||
import { Num } from "file/numbering/num";
|
import { Num } from "file/numbering/num";
|
||||||
import { XmlComponent } from "file/xml-components";
|
import { XmlComponent } from "file/xml-components";
|
||||||
import { PictureRun, Run, TextRun } from "./run";
|
import { PictureRun, Run, TextRun } from "./run";
|
||||||
@ -38,7 +38,7 @@ export class Paragraph extends XmlComponent {
|
|||||||
return run;
|
return run;
|
||||||
}
|
}
|
||||||
|
|
||||||
public createPictureRun(imageData: IData): PictureRun {
|
public createPictureRun(imageData: IMediaData): PictureRun {
|
||||||
const run = new PictureRun(imageData);
|
const run = new PictureRun(imageData);
|
||||||
this.addRun(run);
|
this.addRun(run);
|
||||||
return run;
|
return run;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { Drawing } from "../../drawing";
|
import { Drawing } from "../../drawing";
|
||||||
import { IData } from "../../media/data";
|
import { IMediaData } from "../../media/data";
|
||||||
import { Run } from "../run";
|
import { Run } from "../run";
|
||||||
|
|
||||||
export class PictureRun extends Run {
|
export class PictureRun extends Run {
|
||||||
|
|
||||||
constructor(imageData: IData) {
|
constructor(imageData: IMediaData) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
if (imageData === undefined) {
|
if (imageData === undefined) {
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
import { XmlAttributeComponent } from "file/xml-components";
|
||||||
|
|
||||||
|
export interface IRelationshipAttributesProperties {
|
||||||
|
id: string;
|
||||||
|
type: string;
|
||||||
|
target: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class RelationshipAttributes extends XmlAttributeComponent<IRelationshipAttributesProperties> {
|
||||||
|
protected xmlKeys = {
|
||||||
|
id: "Id",
|
||||||
|
type: "Type",
|
||||||
|
target: "Target",
|
||||||
|
};
|
||||||
|
}
|
23
src/file/relationships/relationship/relationship.ts
Normal file
23
src/file/relationships/relationship/relationship.ts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import { XmlComponent } from "file/xml-components";
|
||||||
|
import { RelationshipAttributes } from "./relationship-attributes";
|
||||||
|
|
||||||
|
export type RelationshipType =
|
||||||
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
|
||||||
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"
|
||||||
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings"
|
||||||
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"
|
||||||
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable"
|
||||||
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings"
|
||||||
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering";
|
||||||
|
|
||||||
|
export class Relationship extends XmlComponent {
|
||||||
|
constructor(id: string, type: RelationshipType, target: string) {
|
||||||
|
super("Relationship");
|
||||||
|
|
||||||
|
this.root.push(new RelationshipAttributes({
|
||||||
|
id,
|
||||||
|
type,
|
||||||
|
target,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
import { XmlComponent } from "file/xml-components";
|
import { XmlComponent } from "file/xml-components";
|
||||||
import { RelationshipsAttributes } from "./attributes";
|
import { RelationshipsAttributes } from "./attributes";
|
||||||
|
import { Relationship, RelationshipType } from "./relationship/relationship";
|
||||||
|
|
||||||
export class Relationships extends XmlComponent {
|
export class Relationships extends XmlComponent {
|
||||||
|
|
||||||
@ -9,6 +10,18 @@ export class Relationships extends XmlComponent {
|
|||||||
xmlns: "http://schemas.openxmlformats.org/package/2006/relationships",
|
xmlns: "http://schemas.openxmlformats.org/package/2006/relationships",
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// this.root.push(new Created());
|
this.createRelationship(1, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles", "styles.xml");
|
||||||
|
this.createRelationship(2, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering", "numbering.xml");
|
||||||
|
}
|
||||||
|
|
||||||
|
public addRelationship(relationship: Relationship): void {
|
||||||
|
this.root.push(relationship);
|
||||||
|
}
|
||||||
|
|
||||||
|
public createRelationship(id: number, type: RelationshipType, target: string): Relationship {
|
||||||
|
const relationship = new Relationship(`rId${id}`, type, target);
|
||||||
|
this.addRelationship(relationship);
|
||||||
|
|
||||||
|
return relationship;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
|
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
|
||||||
|
<Default Extension="png" ContentType="image/png"/>
|
||||||
|
<Default Extension="jpeg" ContentType="image/jpeg"/>
|
||||||
|
<Default Extension="jpg" ContentType="image/jpeg"/>
|
||||||
|
<Default Extension="bmp" ContentType="image/bmp"/>
|
||||||
|
<Default Extension="gif" ContentType="image/gif"/>
|
||||||
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" />
|
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" />
|
||||||
<Default Extension="xml" ContentType="application/xml" />
|
<Default Extension="xml" ContentType="application/xml" />
|
||||||
<Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml" />
|
<Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml" />
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
||||||
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
||||||
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml" />
|
|
||||||
<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering" Target="numbering.xml" />
|
|
||||||
</Relationships>
|
|
Reference in New Issue
Block a user