[scribus] PDF export

Juraj Fedel wtxnh-scribus at yahoo.com.au
Mon Jan 8 01:25:40 UTC 2018


On Sun, Jan 07, 2018 at 03:03:33PM -0500, Gregory Pittman wrote:
> I'll check this out and if I can get the gist, update the manual.

That would be great.
Let me try help with some tips.

Most simple use is to do:
pdf = scribus.PDFfile()
pdf.save()
This is same as opening Export -> Save As PDF dialog and pressing Save button.

Actually pdf object created above is replacement for export dialog.
Everything you can change in dialog you should be able to change in pdf
object too (in theory that is - more often then not python binding is
out of sync from c++ code for this export dialog).

One important thing is that you should use pdf object only for one
export. If you want to export document multiple times you should create
pdf object for each export. Also create pdf object only right before you
want to export document. That is do not change document in any way after
pdf = scribus.PDFfile()
and before
pdf.save()
In between those two commands you should only change pdf attributes (in
python script, not in export dialog!).

pdf object have only one method (pdf.save()) and lot of attributes.
Each setting you can make in export dialog should be mapped to some attribute.
When you do in scripter console:
help(scribus.PDFfile)
you will get list of all supported attributes.

As a help text for those attributes I actually used tooltips for
corresponding element in export dialog.

In help text is (in most cases) indicated what kind of values attribute
accept.
If you are not sure what you should use as value do the folowing:
1. open export dialog and manualy set the attributes as you want them
2. export document to PDF with those values set (from export dialog)
3. in scripter console create pdf object
   pdf = scribus.PDFfile()
4. print the value you are interested in
   print pdf.fonts # or any other attribute/setting
   print pdf.fontEmbedding
   print pdf.subsetList

HTH
Juraj



More information about the scribus mailing list