Save all Scribus pages as EPS
Scribus is great at PDF, but Word isn’t. When I import PDFs into Word, Word converts them to bitmap graphics, which defeats the purpose of embedding PDF. Word does support EPS (as long as you’re printing to a postscript printer, such as CUPS-PDF), but Scribus can’t save pages separately to EPS files all at once like it can PDFs.
This script will go from page to page in the current Scribus document and save it as an EPS file.
[toggle code]
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import scribus
- import os.path
- #don't do anything unless there's a document open
-
if scribus.haveDoc():
- #get the base filename to save to
- #fileDialog seems to require three unnamed arguments
- saveTo = scribus.fileDialog('Select filename to save EPS files', '*.eps *.pdf *.sla', "", issave=True)
-
if saveTo:
- #deselect, or it will only print the current selection
- scribus.deselectAll()
- pagecount = scribus.pageCount()
- basePath, ext = os.path.splitext(saveTo)
-
if not ext:
- basePath = saveTo
-
for page in range(1, pagecount+1):
- scribus.gotoPage(page)
- filepath = basePath + ' page ' + str(page) + '.eps'
- scribus.savePageAsEPS(filepath)
-
else:
- scribus.messageBox("No Open Document", "You need to have a document open to save it as EPS.")
Save this script as something like “scribus2eps.py”, and then select it from your Scribus “Scripts” menu. Whatever filename you select, the script saves as that filename and “ page x.eps”. For example, if you choose "Joe.pdf", and the current document is three pages long, the pages will be saved as “Joe page 1.eps”, “Joe page 2.eps”, and “Joe page 3.eps”.
- CUPS-PDF
- CUPS-PDF lets you print straight to PDF if your system uses CUPS (as Mac OS X does). This lets you create PDFs using all of the print dialog’s printing options, such as more than one page per sheet.
- Scribus
- Scribus is a very nice open source page layout application and includes full PDF creation. It is also scriptable using Python if you need to automate page layout tasks. Scribus is very useful for making documents that need to be shared with other editors, since anyone can get the Scribus application unrestricted.
More Python
- Quick-and-dirty old-school island script
- Here’s a Python-based island generator using the tables from the Judges Guild Island Book 1.
- Astounding Scripts on Monterey
- Monterey removes Python 2, which means that you’ll need to replace it if you’re still using any Python 2 scripts; there’s also a minor change with Layer Windows and GraphicConverter.
- Goodreads: What books did I read last week and last month?
- I occasionally want to look in Goodreads for what I read last month or last week, and that currently means sorting by date read and counting down to the beginning and end of the period in question. This Python script will do that search on an exported Goodreads csv file.
- Test classes and objects in python
- One of the advantages of object-oriented programming is that objects can masquerade as each other.
- Timeout class with retry in Python
- In Paramiko’s ssh client, timeouts don’t seem to work; a signal can handle this—and then can also perform a retry.
- 30 more pages with the topic Python, and other related pages
More Scribus
- Automated Scribus Daredevils NPC character sheets
- Part 2 of 2: the free Scribus page layout software makes it easy to automate the creation of NPC character sheets.
Update: issave=True doesn’t seem to have any effect in fileDialog. The button remains “open” instead of “save”, and the dialog requires choosing an existing file to determine the base name of the file. Just typing a new file name won’t cut it.