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

Sam Nirvana

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
  • Scribus User
Export to PDF via scripter
« 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.

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1585
  • Karma: 23
    • 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:

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)

 

palmate