MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / _on_export_pdf

Method _on_export_pdf

SLiCAP/schematic/window.py:857–874  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

855 QMessageBox.critical(self, "Export SVG failed", str(exc))
856
857 def _on_export_pdf(self):
858 path, _ = QFileDialog.getSaveFileName(
859 self, "Export PDF", self._default_export_path("img", ".pdf"),
860 "PDF (*.pdf);;All Files (*)"
861 )
862 if not path:
863 return
864 p = Path(path)
865 if p.suffix.lower() != ".pdf":
866 p = p.with_suffix(".pdf")
867 from .export import export_pdf
868 from .canvas import SchematicScene
869 try:
870 fresh = SchematicScene()
871 fresh.from_data(self._scene.to_data(), self._library)
872 export_pdf(fresh, p)
873 except Exception as exc:
874 QMessageBox.critical(self, "Export PDF failed", str(exc))
875
876 def _on_print(self):
877 from .export import print_scene

Callers

nothing calls this directly

Calls 5

_default_export_pathMethod · 0.95
from_dataMethod · 0.95
SchematicSceneClass · 0.85
export_pdfFunction · 0.85
to_dataMethod · 0.80

Tested by

no test coverage detected