Created
March 12, 2014 01:31
-
-
Save jrsmith3/9498924 to your computer and use it in GitHub Desktop.
Converts every scribus document to a PDF in a specified directory.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Convert every .sla to a pdf in a specified directory. | |
This script can only be run from within [scribus](http://http://scribus.net). | |
""" | |
import os | |
work_dir = #you have to explicitly tell scribus where your working directory is. | |
filenames = os.listdir(work_dir) | |
for filename in filenames: | |
if filename.endswith(".sla"): | |
full_path = os.path.join(work_dir, filename) | |
filename_root = os.path.splitext(filename)[0] | |
filename_pdf = os.path.join(work_dir, filename_root+".pdf") | |
openDoc(full_path) | |
pdf = PDFfile() | |
pdf.file = filename_pdf | |
pdf.save() | |
closeDoc() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For any others finding this, I've implemented a somewhat more sophisticated command-line and Python API wrapper for Scribus PDF export: https://github.com/sla2pdf-team/sla2pdf