Add image to run
This commit is contained in:
@ -7,9 +7,9 @@ import { SectionPropertiesOptions } from "./document/body/section-properties/sec
|
||||
import { FooterWrapper } from "./footer-wrapper";
|
||||
import { FootNotes } from "./footnotes";
|
||||
import { HeaderWrapper } from "./header-wrapper";
|
||||
import { Media } from "./media";
|
||||
import { Image, Media } from "./media";
|
||||
import { Numbering } from "./numbering";
|
||||
import { Bookmark, Hyperlink, Image, Paragraph } from "./paragraph";
|
||||
import { Bookmark, Hyperlink, Paragraph } from "./paragraph";
|
||||
import { Relationships } from "./relationships";
|
||||
import { Styles } from "./styles";
|
||||
import { ExternalStylesFactory } from "./styles/external-styles-factory";
|
||||
@ -126,19 +126,19 @@ export class File {
|
||||
|
||||
public createImage(filePath: string): Image {
|
||||
const image = Media.addImage(this, filePath);
|
||||
this.document.addParagraph(image);
|
||||
this.document.addParagraph(image.Paragraph);
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
public addImage(image: Image): File {
|
||||
this.document.addParagraph(image);
|
||||
this.document.addParagraph(image.Paragraph);
|
||||
return this;
|
||||
}
|
||||
|
||||
public createImageFromBuffer(buffer: Buffer, width?: number, height?: number): Image {
|
||||
const image = Media.addImageFromBuffer(this, buffer, width, height);
|
||||
this.document.addParagraph(image);
|
||||
this.document.addParagraph(image.Paragraph);
|
||||
|
||||
return image;
|
||||
}
|
||||
|
Reference in New Issue
Block a user