output is saved in pdf without calling freecad

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
diljot6791
Posts: 10
Joined: Thu Jun 02, 2011 9:22 am

output is saved in pdf without calling freecad

Post by diljot6791 »

hi everyone,
Can we do scripting in terminal and our output is saved in pdf (only output in drawing viewer or any 2d objects ) without opening the freecad software. can we call freecad in terminal ??


cheers,
diljot
helo10
Posts: 81
Joined: Tue Feb 21, 2012 7:32 am

Re: output is saved in pdf without calling freecad

Post by helo10 »

hi diljot,

you can start FreeCAD without Gui

Code: Select all

FreeCAD -c
but export to pdf is not possible, I think.

helo
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: output is saved in pdf without calling freecad

Post by NormandC »

Hi,

There's a File --> Export to PDF menu, so it must be possible.
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: output is saved in pdf without calling freecad

Post by wmayer »

For the export of PDF we use some built-in functionality of our GUI toolkit Qt. This class is part of the QtGui module so it means that exporting to a PDF _without_ showing the FreeCAD GUI is _not_ possible.
User avatar
hardeeprai
Posts: 177
Joined: Sun May 23, 2010 2:41 pm
Location: Ludhiana, Punjab, India
Contact:

Re: output is saved in pdf without calling freecad

Post by hardeeprai »

Sad :-(

I admire Linux becasue of it's ability to make things non-interative, and automated. Batch processing is nice thing. OpenOffice may be used as headless, producing pdf from a OpenOffice file is possible. Scene may created in text file and script may be execited to render it and to produce a picture using renderer like Povray.

In that line, I wish to see and use FreeCAD, to produce finished drawing, after reading data, without launch of GUI.

Please suggest, if there is any way. If not, is there demand, other also thing that this feature may be useful. If yes, we may develop it.

--
H.S.Rai
--
H.S.Rai
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: output is saved in pdf without calling freecad

Post by wmayer »

I have played a bit and found a hopefully suitable solution:

We can add a new command line parameter "--output" followed by a file name which tells FreeCAD to save the loaded file.
Therefore we have to load the GUI to have the Pdf export function available and if needed FreeCAD can be hidden (with a second command line parameter "--hidden") so that you won't even realize that it has started. After the export has finished we simply quit FreeCAD again.
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: output is saved in pdf without calling freecad

Post by wmayer »

So, I have implemented the above idea. Once you have the latest version from the sources you can do it like this

E.g.:

Code: Select all

freecad --hidden --output=output.pdf inputfile.fcstd
Post Reply