[scribus] Using scribus to create PDFs from the commandline

William Bader williambader at hotmail.com
Wed Jul 30 16:28:39 UTC 2014



> Date: Wed, 30 Jul 2014 13:02:38 +0200
> From: ale.comp_06 at xox.ch
> To: scribus at lists.scribus.net
> Subject: Re: [scribus] Using scribus to create PDFs from the commandline
> 
> hi juraj
> 
> thanks for sharing this!
> 
> it's possible that i've already tried your patch but failed to compile it...
> 
> i've tried a few of them, and none did compile at the time i've tried them.
> 
> 
> i've browsed through your patch and i have a few comments:
> 
> - first a very simple one: don't mark your comments with a two letters 
> code... while this is fine for AV, CB or other team mebers, in a few 
> months nobody will know who JF is :-). (except if you plan to be a 
> regular contributor: then you're welcome in the club!)
>    as a general rule, i would suggest to sign with your first name if 
> it's unique for scribus and is listed in the about dialog.
>    otherwise, you should provide your firstname and name (and eventually 
> email address...) or a handle wich can be tracked to you (as an example, 
> kunda could use that nichkname even if it is not his real name!)
> 
> - 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...).
> 
> - why is it linux only? the parts that are OS dependent should be marked 
> as such (allowing other people to work on it and further provide patches 
> for other OSes?)
> 
> - what are the known limitations? i guess that it won't run from a real 
> terminal (X11 needed)... and then?
> 
> - and of course such a patch should be against 1.5svn ... but iirc this 
> issue has been already (easily) solved by william!
> 
> once the limitations are clearly documented and the "ugly hack" has been 
> -- if possible -- unuglified i think that we should look for integrating 
> this in the trunk!
> 
> thanks for sharing your patch!
> a.l.e
I have posted a version of Juraj's patch that works against 1.5.0svn.
I only had to apply one part by hand, and I changed "pythonScript = QFile::decodeName(argv()[i + 1]);" to "pythonScript = QFile::decodeName(args[i + 1].toLocal8Bit());".
http://bugs.scribus.net/view.php?id=12572
My build environment is only Linux (Fedora 20), but the patch does not seem to contain anything operating system dependent, and I suspect that Juraj was being cautious when he said Linux-only because it was never tested under Windows rather than because there is any reason that it should not work.
At least on Linux, it still opens a window.  The window does not need any user interaction and closes when the script finishes, so that is OK for my purposes.  I imagine that on any x11 environment, you could create a virtual desktop with vncserver and connect Scribus to the virtual desktop instead of to a physical screen.
I think that the "ugly" comment relates to the Scribus useGUI variable.  When running a python script, even though there is no GUI, the useGUI variable must be true, because if it is false, Scribus does not do anything.
The useGUI variable might be better as an enumeration of four values: no GUI because there were errors on the command line that prevent Scribus from starting, no GUI because the user specified the --no-gui command line option, non-interactive GUI because the user is running a script with --python-script, and normal interactive GUI.  Or maybe as several boolean variables like fatal error, running a python script, gui needed.
If Juraj does not have time to make the changes, and if you can be clear about what it would take to make the patches acceptable, I would be willing to try.
Regards,William


 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20140730/36da9de2/attachment.html>


More information about the scribus mailing list