drawio-desktop
drawio-desktop copied to clipboard
Exporting PDF Adds Extra Pages
Preflight Checklist
- [x] I agree to follow the Code of Conduct that this project adheres to.
- [x] I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Describe the bug When exporting a drawing as a PDF extra blank pages will be created.
To Reproduce Steps to reproduce the behavior:
- Go to File -> Export as -> PDF...
- Click on Export
- Click on Save
- Open the PDF that was just saved and there will be extra blank pages.
Expected behavior Expectation is not having extra blank pages in the PDF.
Screenshots If applicable, add screenshots to help explain your problem.
draw.io version (In the Help->About menu of the draw.io editor):
- draw.io version 15.8.7
Desktop (please complete the following information):
- OS: Windows 10
Additional context The drawing I tested with was set to a paper size of US-Letter (8,5" x 11"). The PDF is showing a paper size of 8.51 x 11.01.
Are you having the same issue with both Portrait and Landscape US-Letter (8,5" x 11") orientation, please? How many pages does your diagram have? Do you have the same problem with other paper sizes?
Thanks,
Landscape does not produce extra pages however, the exported page size is still wrong, 11.00 x 8.53 instead of 11.00 x 8.50.
My diagram only has one page.
Exporting a US-Tabloid (11" x 17") landscape does not produce extra pages but the page size is wrong, 17.00 x 11.01 instead of 17.00 x 11.00.
Exporting a US Tabloid (11" x 17") portrait does not produce extra pages but the page size is wrong, 11.00 x 17.01 instead of 11.00 x 17.00.
Were you unable to reproduce the issue?
US-Letter (8,5" x 11") Portrait orientation extra blank page - reproduced with 15.8.7 on Win 10 Pro.
Does File > Print > Print to PDF/Save as PDF help as a workaround? At my place it doesn't show extra blank page.
Using the print to PDF option is not a acceptable workaround because when using that option the scaling of the drawing is wrong. For example, if I have a box that creates a border 0.5" from the edge of the page, exporting the drawing as a PDF the border is positioned correctly. Using the print to PDF option the border is not positioned correctly. I have attached the test PDF files for your review. PDF print test.pdf PDF export test.pdf
I have experienced this same behavior using 15.8.7 on Win 10 Pro. As a work around, I use a Custom paper size of 8.49 x 10.99, which then outputs a single page PDF of 8.5 x 11. Seems it has to do with the export adding that extra 0.01" to the PDF.
This bug is still present in 17.2.4.
I have a similar problem using v17.2.4 on Ubuntu 20.04.
This problem can be reproduced by the command line ( it seems to be file-dependent ). Attached 050_010_overview.zip reproduce this problem with the following command line.
drawio -xf pdf --crop -b 10 050_010_overview.drawio
This command generates a two pages PDF while only one page is expected. See the following screenshot.

By quick investigation, I found the option "-b" makes this problem. The following command line doesn't generate an extra PDF page.
drawio -xf pdf --crop 050_010_overview.drawio
Of course, we will lose the expected border area, in this case.
This problem can be also reproduced on the GUI operation. To reproduce,
- Go to File -> Export as -> Advanced...
- Set PDF to the file format.
- Set a non-zero value to the border width.

Here's another quick solution. File -> Export As -> PDF. Tick the crop option and that's it.
Using the crop option will create a page size smaller than what the paper size is set at within draw.io. For example if I have a single box on the 8.5"x11" page that is 1"x2", when I export to PDF with the crop option the page size ends up being 1.01"x2.04".
same problem. This bug is giving me carpal tunnel syndrome
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. See the FAQ for more information.
This issue still persists.