[scribus] batch mode option for scribus a la gimp script-fu-server
Juraj Fedel
wtxnh-scribus at yahoo.com.au
Sun Sep 5 16:19:48 CEST 2010
On Sat, Aug 28, 2010 at 07:45:26PM +0200, Farid Elyahyaoui wrote:
> I saw that there is a long standing feature request for a command line
> version of Scribus to be able to create pdf's in a batch mode
> (http://bugs.scribus.net/view.php?id=238). Our company now has a student that
> could invest a couple of months development time in such a feature.
...
> Additionally we could add a "--no-interface" option to stop the gui from
> being shown and also switch of rendering of the document to speed up things.
> (An alternative would be to start scribus with the display set to a virtual
> display using Xvfb.)
Hi,
I just wanted to share some of myexperience with this issue even if am
not in the scribus development team.
Back in year 2006 I implemmented batch mode for scribus. What I was
able to do is:
- load and save PDF options from scripter into/from xml file
- export pdf from command line
scribus --to-pdf exported.pdf --pdf-options options.xml document.sla
- run python script
scribus --script program.py [arg1 [arg2 ...]]
As I was using this I preffered to run puthon script and from there export
PDF file (you can also export PS file from scripter if you need to) instead
of using --to-pdf option.
Something like:
openDoc('document.sla')
pdf = PDFOptions()
pdf.loadPDFOptions('options.xml')
pdf.filename = 'exported.pdf'
pdf.embedList = getUsedFontNames()
pdf.savePDF()
p = Printer()
p.filename = 'exported.ps'
p.printer = 'File'
p.savePS()
closeDoc()
This worked and satisfied my needs perfectly. It was able to work
without rendering any window on the desktop but it needed X server
nevertheless. Problem with it is that I was using scribus 1.3.2 at the
time and did not upgraded since then. It also was really just a fast
ugly hack and when I passed the patch to developers it must have been
dificult for them to us it. Instead of creating clean patch for each
feature I mixed it all together also with some code cleaning at random
places, fixing some bugs and who know what not. Anyway developers
stated that they will try to adapt the patch and include it in 1.3.4
version. Considering what mess I send them it is no wonder if
developers could not use it at all - my bad :(
So the task is not impossible it just need more attention to do it
right.
Good luck
Juraj Fedel
More information about the scribus
mailing list