Minimal Viable Product + Refactor to pinia store + Fix PDF export
This commit is contained in:
@@ -1,13 +1,33 @@
|
||||
import { jsPDF } from "jspdf";
|
||||
|
||||
export function exportToPdf(element: HTMLElement, name: string) {
|
||||
const pdf = new jsPDF();
|
||||
// const pdf = new jsPDF({orientation: 'portrait', unit: 'mm', format: 'a4', precision: 1, hotfixes: ["px_scaling"]});
|
||||
|
||||
// pdf.html(element, {
|
||||
// callback: function (doc) {
|
||||
// doc.save(name);
|
||||
// },
|
||||
// margin: [0, 0, 0, 0],
|
||||
// autoPaging: 'text',
|
||||
// // width: 210,
|
||||
// // windowWidth: 2100,
|
||||
// html2canvas: {
|
||||
// allowTaint: true,
|
||||
// letterRendering: true,
|
||||
// logging: true,
|
||||
// // width: 210,
|
||||
// // windowWidth: 2100,
|
||||
// // scale: 0.2,
|
||||
// // scale: 210 / element.scrollWidth,
|
||||
// },
|
||||
// });
|
||||
|
||||
const pdf = new jsPDF({ orientation: 'portrait', unit: 'mm', format: 'a4' });
|
||||
pdf.html(element, {
|
||||
callback: function (doc) {
|
||||
doc.save(name);
|
||||
},
|
||||
width: 210,
|
||||
windowWidth: element.scrollWidth,
|
||||
windowWidth: 1080,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user