Exporting TechDraw page as pdf or svg?

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
Parth
Posts: 3
Joined: Thu Nov 26, 2020 12:10 am

Exporting TechDraw page as pdf or svg?

Post by Parth »

Hello Everyone,

I'm trying to exprot a TechDraw page as an SVG or PDF file. No success yet. Can anyone help me in doing it with Python? I'll be running my script in CLI, no gui module loaded.

thanks a lot!
User avatar
ebrahim raeyat
Posts: 621
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: Exporting TechDraw page as pdf or svg?

Post by ebrahim raeyat »

maybe this can help:

this is for getting information from techdraw:

https://github.com/ebrahimraeyat/momen/ ... aw.py#L251

and this two links for converting the lines and dimensions to pdf:

https://github.com/ebrahimraeyat/momen/ ... aw.py#L251
https://github.com/ebrahimraeyat/Civil/ ... ort.py#L73
Parth
Posts: 3
Joined: Thu Nov 26, 2020 12:10 am

Re: Exporting TechDraw page as pdf or svg?

Post by Parth »

Hello ebrahim raeyat,
thanks for the help.
I checked the links and they refer to dxfs. I'm trying to get SVG.

I tried to export DXF using GUI and it wasn't accurate, some dimensions were moved. I exported SVG with GUI and worked really well. So I believe, SVG export is more stable than dxf export.

I want to do that using CLI and python console without loading GUI. Do you have any references that can help me with that?

Thanks,
Parth
User avatar
ebrahim raeyat
Posts: 621
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: Exporting TechDraw page as pdf or svg?

Post by ebrahim raeyat »

Reinforcement WB extensively use svg for reporting, for example:

https://github.com/amrit3701/FreeCAD-Reinforcement
Post Reply