feature: generate pdf from actor

This commit is contained in:
Matthieu CAILLEAUX
2021-10-16 23:58:31 +02:00
parent 1babf13dae
commit f96372b236
18 changed files with 1826 additions and 14 deletions

22
src/elements/image.ts Normal file
View 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;
}
}