Skip to content

Commit

Permalink
Fixed print page size (#drawio-desktop-1893)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohamedin committed Oct 24, 2024
1 parent 7945aa1 commit 271ea6b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -1759,8 +1759,15 @@ function exportDiagram(event, args, directFinalize)
{
pdfOptions = {
scaleFactor: args.pageScale,
preferCSSPageSize: true,
printBackground: true
printBackground: true,
pageSize : {
width: args.pageWidth * MICRON_TO_PIXEL,
//This height adjustment fixes the output. TODO Test more cases
height: (args.pageHeight * 1.025) * MICRON_TO_PIXEL
},
margins: {
marginType: 'none' // no margin
}
};

contents.print(pdfOptions, (success, errorType) =>
Expand Down

0 comments on commit 271ea6b

Please sign in to comment.