Skip to content

Commit

Permalink
Update windowWidthattribute for consistent pdf view across difference…
Browse files Browse the repository at this point in the history
… display sizes
  • Loading branch information
lucasxsong committed Feb 29, 2024
1 parent 4b9cf14 commit a956fba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/ScoreReport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ const pageWidth = 190; // Set page width for calculations
const returnScaleFactor = (width) => pageWidth / width; // Calculate the scale factor
// Helper function to add an element to a document and perform page break logic
const addElementToPdf = async (element, document, yCounter, offset = 0) => {
await html2canvas(element).then(function (canvas) {
await html2canvas(element, { windowWidth: 1100, scale: 2 }).then(function (canvas) {
const imgData = canvas.toDataURL('image/jpeg', 0.7, { willReadFrequently: true });
const scaledCanvasHeight = canvas.height * returnScaleFactor(canvas.width);
// Add a new page for each task if there is no more space in the page for task desc and graph
Expand Down

0 comments on commit a956fba

Please sign in to comment.