MapComplete/Logic/Actors/PDFLayout.ts
2021-07-27 15:51:47 +02:00

20 lines
No EOL
572 B
TypeScript

/**
* Adds a theme to the pdf
*/
import jsPDF from "jspdf";
export class PDFLayout {
public AddLayout(layout: string, doc: jsPDF, image: Blob){
if(layout === "natuurpunt") this.AddNatuurpuntLayout(doc, image);
}
public AddNatuurpuntLayout(doc: jsPDF, image: Blob){
// Add Natuurpunt layout
const screenRatio = screen.width/screen.height;
let img = document.createElement('img');
img.src = './assets/themes/natuurpunt/natuurpunt.png';
doc.addImage(img, 'PNG', 15, 5, 20, 20);
doc.addImage(image, 'PNG', 15, 30, 150*screenRatio, 150);
return doc;
}
}