added create picture run method

This commit is contained in:
Dolan
2017-03-13 23:41:14 +00:00
parent 260a680f56
commit 30b21217a9

View File

@ -1,5 +1,6 @@
import { Num } from "../../numbering/num"; import { Num } from "../../numbering/num";
import { Run } from "../run"; import { Run } from "../run";
import { PictureRun } from "../run/picture-run";
import { TextRun } from "../run/text-run"; import { TextRun } from "../run/text-run";
import { XmlComponent } from "../xml-components"; import { XmlComponent } from "../xml-components";
@ -36,6 +37,12 @@ export class Paragraph extends XmlComponent {
return run; return run;
} }
public createPictureRun(imagePath: string): PictureRun {
const run = new PictureRun(imagePath);
this.addRun(run);
return run;
}
public heading1(): Paragraph { public heading1(): Paragraph {
this.properties.push(new Style("Heading1")); this.properties.push(new Style("Heading1"));
return this; return this;