How does one call the SVG ord PDF export for a Page from Python

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
tobiasfalk
Posts: 93
Joined: Fri Feb 05, 2021 2:35 pm

How does one call the SVG ord PDF export for a Page from Python

Post by tobiasfalk »

How does one call the SVG or PDF export fo a Page from Python
BUnbenannt.JPG
BUnbenannt.JPG (52.36 KiB) Viewed 418 times
User avatar
wandererfan
Veteran
Posts: 6317
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: How does one call the SVG ord PDF export for a Page from Python

Post by wandererfan »

tobiasfalk wrote: Sun May 07, 2023 1:10 pm How does one call the SVG or PDF export fo a Page from Python

Code: Select all

import FreeCAD
import TechDrawGui

p = FreeCAD.ActiveDocument.Page

f = "/home/localuser/myPdfDirectory/savePage.pdf"
TechDrawGui.exportPageAsPdf(p, f)

f = "/home/localuser/mySvgDirectory/savePage.svg"
TechDrawGui.exportPageAsSvg(p, f)
Post Reply