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!
diljot6791
Posts: 10
Joined: Thu Jun 02, 2011 9:22 am

output is saved in pdf without calling freecad

Postby diljot6791 » Sun Mar 18, 2012 6:50 pm

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

Postby helo10 » Sun Mar 18, 2012 8:14 pm

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
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: output is saved in pdf without calling freecad

Postby NormandC » Mon Mar 19, 2012 4:27 am

Hi,

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

Re: output is saved in pdf without calling freecad

Postby wmayer » Mon Mar 19, 2012 10:29 am

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: 173
Joined: Sun May 23, 2010 2:41 pm
Location: Ludhiana, Punjab, India
Contact:

Re: output is saved in pdf without calling freecad

Postby hardeeprai » Thu Mar 29, 2012 6:37 pm

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
Site Admin
Posts: 15756
Joined: Thu Feb 19, 2009 10:32 am

Re: output is saved in pdf without calling freecad

Postby wmayer » Fri Mar 30, 2012 4:44 pm

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
Site Admin
Posts: 15756
Joined: Thu Feb 19, 2009 10:32 am

Re: output is saved in pdf without calling freecad

Postby wmayer » Sat Mar 31, 2012 12:11 pm

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