Revert returning Paragraph
This commit is contained in:
@ -61,14 +61,14 @@ export class Document extends XmlComponent {
|
||||
this.body.push(pictureParagraph);
|
||||
}
|
||||
|
||||
public createDrawing(imageData: IMediaData): Paragraph {
|
||||
public createDrawing(imageData: IMediaData): PictureRun {
|
||||
const paragraph = new Paragraph();
|
||||
const run = new PictureRun(imageData);
|
||||
|
||||
paragraph.addRun(run);
|
||||
this.addDrawing(paragraph);
|
||||
|
||||
return paragraph;
|
||||
return run;
|
||||
}
|
||||
|
||||
get Body(): Body {
|
||||
|
@ -10,7 +10,7 @@ import { FootNotes } from "./footnotes";
|
||||
import { HeaderWrapper } from "./header-wrapper";
|
||||
import { Media } from "./media";
|
||||
import { Numbering } from "./numbering";
|
||||
import { Bookmark, Hyperlink, Paragraph } from "./paragraph";
|
||||
import { Bookmark, Hyperlink, Paragraph, PictureRun } from "./paragraph";
|
||||
import { Relationships } from "./relationships";
|
||||
import { Styles } from "./styles";
|
||||
import { ExternalStylesFactory } from "./styles/external-styles-factory";
|
||||
@ -125,7 +125,7 @@ export class File {
|
||||
return this.document.createTable(rows, cols);
|
||||
}
|
||||
|
||||
public createImage(filePath: string): Paragraph {
|
||||
public createImage(filePath: string): PictureRun {
|
||||
const mediaData = Media.addImage(this, filePath);
|
||||
return this.document.createDrawing(mediaData);
|
||||
}
|
||||
@ -135,7 +135,7 @@ export class File {
|
||||
return this;
|
||||
}
|
||||
|
||||
public createImageFromBuffer(buffer: Buffer, width?: number, height?: number): Paragraph {
|
||||
public createImageFromBuffer(buffer: Buffer, width?: number, height?: number): PictureRun {
|
||||
const mediaData = Media.addImageFromBuffer(this, buffer, width, height);
|
||||
return this.document.createDrawing(mediaData);
|
||||
}
|
||||
|
Reference in New Issue
Block a user