drawio-desktop icon indicating copy to clipboard operation
drawio-desktop copied to clipboard

Exporting PDF Adds Extra Pages

Open bt-tech-dd opened this issue 3 years ago • 10 comments

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:

  1. Go to File -> Export as -> PDF...
  2. Click on Export
  3. Click on Save
  4. 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.

bt-tech-dd avatar Dec 02 '21 16:12 bt-tech-dd

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,

mararad avatar Dec 06 '21 12:12 mararad

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?

bt-tech-dd avatar Dec 06 '21 13:12 bt-tech-dd

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.

mararad avatar Dec 07 '21 11:12 mararad

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

bt-tech-dd avatar Dec 07 '21 14:12 bt-tech-dd

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.

spidermonkdust avatar Dec 15 '21 19:12 spidermonkdust

This bug is still present in 17.2.4.

bt-tech-dd avatar Mar 29 '22 17:03 bt-tech-dd

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. Screenshot from 2022-04-03 10-26-40

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,

  1. Go to File -> Export as -> Advanced...
  2. Set PDF to the file format.
  3. Set a non-zero value to the border width.

Screenshot from 2022-04-03 10-39-14

suikan4github avatar Apr 03 '22 01:04 suikan4github

Here's another quick solution. File -> Export As -> PDF. Tick the crop option and that's it.

JacobChikwanda avatar Jul 27 '22 13:07 JacobChikwanda

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".

bt-tech-dd avatar Jul 27 '22 15:07 bt-tech-dd

same problem. This bug is giving me carpal tunnel syndrome

macdonaldtomw avatar Sep 26 '22 17:09 macdonaldtomw

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.

stale[bot] avatar Mar 25 '23 17:03 stale[bot]

This issue still persists.

gusmaogabriels avatar Jul 19 '23 14:07 gusmaogabriels