drawio-batch
drawio-batch copied to clipboard
add crop option for PDF format
Added an option '-c' to add the ability to export a cropped version of PDF instead of the paginated. So it is now possible to export the draw as a whole one page PDF.
It's a little hack by setting negativ height that leads to skip pagination for PDF format in export3.html (line 231):
// Handles PDF output where the output should match the page format if the page is visible
if (data.format == 'pdf' && xmlDoc.documentElement.getAttribute('page') == '1' && data.w == 0 && data.h == 0)
Thanks for the PR!
Is this intended to crop a one-page document to the boundaries of the drawing? In case you want that, you can uncheck the "page view" option in the document and the PDF is automatically generated to be only the drawing.
Actually it is intended to crop any drawing to its boundaries so I get a one-page PDF even the drawing spreads about multiple pages. Is unchecking the "page view" option doing the same? I need to check...
I haven't used multi-page documents much, but for a single page this effectively crops to the drawing.