feature: generate pdf from actor
This commit is contained in:
22
src/elements/image.ts
Normal file
22
src/elements/image.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Box } from './box';
|
||||
import jsPDF from 'jspdf';
|
||||
|
||||
export class Image extends Box {
|
||||
public imageData: string;
|
||||
|
||||
constructor(x: number, y: number, w: number, h: number, imageData: string) {
|
||||
super(x, y, w, h);
|
||||
this.imageData = imageData;
|
||||
}
|
||||
|
||||
public render(doc: jsPDF, _maxWidth?: number): jsPDF {
|
||||
doc.addImage({
|
||||
imageData: this.imageData,
|
||||
x: this.x,
|
||||
y: this.y,
|
||||
width: this.w,
|
||||
height: this.h,
|
||||
});
|
||||
return doc;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user