ExPdfExport.dox 937 B

12345678910111213141516171819202122232425262728293031323334
  1. /*!
  2. \page ExPdfExport Exporting a Drawing to PDF
  3. To export a document to PDF, we can use the printing framework of QCAD
  4. which is itself implemented in ECMAScript. To do this, we simply include
  5. the class Print:
  6. \snippet ExPdfExport.jsd include
  7. To print or export a drawing to PDF, we need a visual representation of
  8. the drawing first. This is achieved through a graphics scene with an
  9. attached view:
  10. \snippet ExPdfExport.jsd view
  11. In most cases, we need to configure the page size, scale factor and
  12. other settings before we can produce a usable PDF output. This is done
  13. by setting various custom variables in our document. Not that a document
  14. might already have these settings, for example if it was previously
  15. printed or exported in QCAD.
  16. \snippet ExPdfExport.jsd settings
  17. The actual export is done through function 'print':
  18. \snippet ExPdfExport.jsd export
  19. \section complete Complete code:
  20. \snippet ExPdfExport.jsd main
  21. */