Enable Epub export


#1

Hi,

I want to enable epub export on Pressbooks (on apache2 server).
Do I need to install the EpubCheck validation tool?
I read the documentation, but not really understand what to do after I downloaded the EpubCheck from their git account.

thanks a lot!
Etna


#2

Yes, you do.

Your server needs Java installed. You need to put the epubcheck.jar file somewhere where it is accessible, such as /opt/epubcheck/epubcheck.jar. In this example, the command to run EpubCheck (PB_EPUBCHECK_COMMAND in wp-config.php ) will be:

/usr/bin/java -jar /opt/epubcheck/epubcheck.jar

If you run:

/usr/bin/java -jar /opt/epubcheck/epubcheck.jar -help

You should see:

EpubCheck v4.0.2

When running this tool, the first argument should be the name (with the path)
of the file to check.

...

If your server does not support Java, you can bypass the requirement by putting this code in a file (say, epub.php) in your wp-content/mu-plugins/ directory:

<?php

add_filter( 'pb_epub_has_dependencies', '__return_true' );

#3

Hi Ned,

Thank you so much for your help, it really worked! and I can export Epub files.
I try to install KindleGen (added the kindle folder and changed the wp-config as well), but it didn’t work (the checkbox of MOBI option in the export window is disabled)

As an attempt, I deleted the epub and kindle dependencies lines in the wp-config, but the epub checkbox in the export window is still enabled (and I can download my book as an Epub file).
How can it be possible if I deleted the lines?

really appreciate your help!


#4

This is probably because we cache the dependency check results. If you delete your transients you will see that the checkbox is disabled again.