View Revisions: Issue #12572

Summary 0012572: [patch] Add a --python-script command line option to run a script and exit
Revision 2014-08-29 04:09 by Kunda
Additional Information From http://lists.scribus.net/pipermail/scribus/2014-July/050757.html

You can create template scribus document 'mydoc.sla' with two text
frames and this small python script 'data.py' in the same directory:

import scribus
scribus.openDoc('mydoc.sla')
scribus.setText('Name', 'Text1') # get 'Name' and 'Address' from database
scribus.setText('Address', 'Text2')
pdf = scribus.PDFfile()
pdf.file = 'output1.pdf'
pdf.save()

Then run scribus as folow:
scribus --python-script data.py

and you have your output1.pdf file created!

WARNING!
- Use only python script without bugs (he, he :)
- You will anyway find some limitation because scribus really is not in
  its core coded for use without GUI

PS:
I have been posting this or similar solution since 2006 (and Scribus
version 1.2 I was using at that time).
Revision 2014-07-29 19:44 by william
Additional Information From http://lists.scribus.net/pipermail/scribus/2014-July/050757.html

You can create template scribus document 'mydoc.sla' with two text
frames and this small python script 'data.py' in the same directory:

import scribus
scribus.openDoc('mydoc.sla')
scribus.setText('Name', 'Text1') # get 'Name' and 'Address' from database
scribus.setText('Address', 'Text2')
pdf = scribus.PDFfile()
pdf.file = 'output1.pdf'
pdf.save()

Then run scribus as folow:
scribus --python-script data.py

and you have your output1.pdf file created!

WARNING!
- This is for linux only. And it is for stable version of Scribus-1.4.4
  (because that is what I use).
- Use only python script without bugs (he, he :)
- You will anyway find some limitation because scribus really is not in
  its core coded for use without GUI

PS:
I have been posting this or similar solution since 2006 (and Scribus
version 1.2 I was using at that time).