PrincePDF: export epubs as .pdf files
(based on prince xml)
Current Version: "0.3.5"
This plugin is a very simple
prince PDF output wrapper, which allows you to export the currently loaded epub as a .pdf file.
This plugin does not support non-standard epubs. Select Tools > Restructure Epub to Sigil Norm before running this plugin with Sigil 1.0 and higher.
Credits: This plugin was inspired by
Jellby's Calibre prince plugin.
Jellby was also extremely helpful in tracking down a Windows prince issue and provided other helpful pointers. If you encounter problems with my plugin I strongly recommend that you give Jellby's more polished version a try, which also comes with a nice GUI.
System requirements
If you're using an older Sigil version, you'll need to install a Python 3.4.x interpreter (the plugin won't work with Python 2.7.x) and select its path in the Manage Plugins dialog box. You'll obviously also need to
install prince, which can't be bundled with the plugin for licensing reasons. (Make sure to install prince in the default location.)
Note that prince will add a tiny watermark in the upper right corner of the first page. However, it can be easily deleted with Acrobat Reader.
Installation
1. Select Manage Plugins from the Plugins menu. In the Manage Plugins dialog box, select
Use Bundled Python, if it isn't already selected. (If your Sigil version doesn't have a
Use Bundled Python option, click the Python 3.4 button to detect the path or Set to manually select the Python interpreter path.)
2. Click Add Plugin and select
PrincePDF_v0.3.5.zip if you're using Sigil 0.9.8 or higher. Otherwise select
PrincePDF_v0.3.0.zip. This will install the plugin, which you can select via Plugins >
output > PrincePDF.
Preferences
This plugin doesn't come with a GUI, but you can change several settings via plugin preference settings. (All of these settings need to be terminated with a comma unless it's the last line in the .json file.)
1. There's a skeleton style.css file in the plugin folder that you can use to customize the pdf output. If you want to use it, update style.css as needed and add the following line to
PrincePDF.json:
2. By default the plugin will copy the pdf file to the user's desktop, but you can define a different folder using the following line:
Code:
"output_dir": "C:\\Users\\User\\Desktop",
Note that in Windows paths you'll need to have to write the backslash twice.
3. You can also define the following values:
media,
page_size,
page_margin,
no_author_style and
no_default_style, which set the corresponding prince command line values.
For example, the following entry will change the page size to A4:
(Note that
style,
no_author_style and
no_default_style can only have the Boolean values
true and
false, without quotation marks.) For more information on the above settings, see the
Prince website.
Postprocessing with cpdf
If you have
cpdf installed, you can reduce the size of the .pdf file generated by Prince with
cpdf. (Depending on the epub source files, this'll reduce the file size by up to 10%.)
This option is disabled by default. To enable it, change the following entry in PrincePDF.json:
(If this entry is the last entry in PrincePDF.json, remove the trailing comma.)
You'll also need to download the
cpdf Community Release binaries and copy the binary file to a system folder, for example
C:\Windows.
License: GNU General Public License v3 (GPL-3)