Scribus Forums

Scribus => Scripts and Plugins => Topic started by: Sam Nirvana on January 07, 2018, 06:00:20 pm

Title: Export to PDF via scripter
Post by: Sam Nirvana on January 07, 2018, 06:00:20 pm
Hello.

The help system of scribus 1.5.3 is not clear about exporting a document to PDF via python scripter.

Say I have a document opened in scribus named "simpledoc.sla" with 55 pages;
I want to export to PDF pages from 21 to 24 as "fourpages.pdf".

Can you put down a chunk of python code that does what I have just said?

Just one or two lines of python code, not more.

Thanks.
Title: Re: Export to PDF via scripter
Post by: a.l.e on January 08, 2018, 10:35:30 am
the question has been answered in the mailing list by juraj:

http://lists.scribus.net/pipermail/scribus/2018-January/054841.html

Code: [Select]
import scribus
pdf = scribus.PDFfile()
pdf.pages = [21, 22, 23, 24]
pdf.file = 'fourpages.pdf'
pdf.save()

@sam / sergio / guests5114: you asked the question on irc, mailing list and in this forum (at least...).
if you get a reply, please consider following up on each channel, telling everybody that you got a reply elsewhere, and link / copy the solution.
(most of the time, it's useful to summarize the solutions you got, even if you're not 100% happy with what you got)