QCAD Bugtracker

  • Status Closed
  • Percent Complete
  • Task Type Bug Report
  • Category QCAD (main)
  • Assigned To
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version 3.4.5
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: QCAD Bugtracker
Opened by Tamas TEVESZ - 29.12.2013
Last edited by Andrew - 15.04.2014

FS#1001 - PDF export fails silently

I only have Git head operational now (am on FreeBSD ATM), but looking at the respective scripts in the downloadable Pro trial, it is affected too. Also, only FreeBSD at the moment to try, but the nature of the bug makes me say all systems are affected.

PDF export fails silently if a file name for which no parent directory exists or that parent directory is not writeable by the current user.

How to reproduce: XD, then in the Save As dialog, manually specify a nonexistent directory + a file name (eg. “/nonexistent/out.pdf” on POSIX, whatever on Windows) or, if you will, browse to a directory for which you have no write permission, specify any file name, then hit Save (case in point: it is not limited to the probably rare-ish cases when the end user browses to the destination directory as opposed to just quickly typing in the full file path).

Result is “Export complete” on the status line. It obviously didn’t complete.

The cause is insufficient checking of the return value of QPainter::begin() in scripts/File/Print/Print.js:

 149     var painter = new QPainter();
 150     painter.begin(printer);

This will actually return false if the output format is PdfFormat and it can not create OutputFileName (cf. Print.js:70-71).

I am not sure how (if at all) it can fail if printing is done to an actual printer.

Setting to medium since in some sense it is silent data loss.

Closed by  Andrew
15.04.2014 19:11
Reason for closing:  Fixed
Additional comments about closing:  

https://github.com/qcad/qcad/commit /b35cb7debf340cc686d6cc7c3f4e45f657c93c7 0


Available keyboard shortcuts


Task Details

Task Editing