Author Topic: Export to PDF via scripter  (Read 1936 times)

Sam Nirvana

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
  • Scribus User
Export to PDF via scripter
« on: January 07, 2018, 06:00:20 pm »

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.



  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2473
  • Karma: 36
    • the graphics lab
Re: Export to PDF via scripter
« Reply #1 on: January 08, 2018, 10:35:30 am »
the question has been answered in the mailing list by juraj:

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

@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)