[scribus] Using scribus to create PDFs from the commandline

Craig Bradney cbradney at scribus.info
Thu Jul 31 18:17:20 UTC 2014


>> - staying with the "ugly hack": what should be changed in scribus to
>> avoid it? how much effort is it, to make a patch to get scribus to
>> currectly test if it should run (and not test for the GUI as a proxy
>> for it...).
> 
> The reason I said it is _ugly_ hack becuse it need to be placed in condition
>         if (app.useGUI)
>         {
>         ...
>         }
> 
> (see main_nix.cpp). I don not understand what for useGUI is used at all.
> If GUI can not be created (for some error/or whatever) the reason should
> be printed to console and scribus should exit at once (without need for
> testing app.useGUI in main_*.cpp files). As a matter of the fact 1.4.4
> source have undocumented option --no-gui that set useGUI to false. If
> you use this option all that scribus is doing is parsing the command
> line and then exit. I fail to grasp meaning of this.

Because a long long time ago in a galaxy far far away, we started to do some more splitting of code
to have some of Scribus run with or without a GUI. We'd need to eliminate almost all of scribus.cpp
and many other parts of other files into other functions to make it possible to run headless.

> As for needed changes is scribus to correctly handle app.useGUI I am in
> no position to say anything. If I correctly recall you started a project
> at the beginning of 2013 to extract PDF producing code out of scribus
> and make it usable to convert .sla file to PDF from console. How is that
> project going?

scribus.cpp, scribusview.cpp, and probably 100 or more other files would need rewriting to run
scribus in headless mode. To add definition to that, I mean, to have some interface like pipes or
sockets to be able to send commands to a Scribus that has no windows. Eg "new doc, create text frame
at 10,10pt with size 100,100pt" sent as a message to a headless Scribus, then "save doc" and you
have an sla file. Much of the scribusdoc code is written to deal with this already, but there's a
ton of functionality in other major files like scribus.cpp that needs a lot of moving about.

Craig

Craig




More information about the scribus mailing list