Pressbooks EPUB and PDF files are made to be compatible with the submission specifications at all major ebook stores and print-on-demand services. However, sometimes markup that isn’t compatible with the EPUB or PDF file formats can be imported into Pressbooks when you bring in your content. We recommend testing your files before you submit them to your distributor of choice to make sure they pass all specifications. You can receive validation logs (or error reports) from Pressbooks directly to your email. Read on to find out more about:
You can decide whether or not you want to receive validation logs for all your exported files. To enable or modify this setting:
- Go to Settings > Export from the left sidebar menu in Pressbooks
- Next to “Email Validation Logs,” choose either “Yes” or “No”
- Click Save Changes
By default, all books’ Email Validation Log setting is set to “No. Ignore validation errors.” If you choose to receive validation logs (or error reports) from Pressbooks, all file validation error logs will be forwarded to the email address associated with your Pressbooks account.
Afterward, you’ll receive a message whenever any file you export has an error. You’ll know exported files contain errors if you see a banner at the top of the Export screen that reads: “Warning: The export has validation errors. See logs for more details.”
Each type of file is created with a different software, so each type of file will have a slightly different validation log. Read on to see how to interpret each type of validation log.
EPUB validation logs will appear in your email inbox with the following subject line: Pressbooks\Modules\Export\Epub\Epub201
Below is an example of what an error report may look like.
[time] => Mon Dec 10 22:17:33 2018
[user] => tmcgrath
[site_url] => https://yourbooktitle.pressbook
[blog_id] => 107381
[theme] => Atwood
Check finished with errors.
How to Read an EPUB Validation Log
The validation log can be broken down into parts. The first part is metadata that identifies your book. You’ll see the time the book was exported, username of the person who exported the book, and the URL of the book in Pressbooks. You’ll also see other internal data, like your book’s WordPress ID number and the theme your book was built with. After the metadata are the error logs:
ERROR(RSC-020): This code identifies what type of error has been caught. The code correlates to the description at the end of the entry log.
chapter-035-your-chapter.html: This information tells you exactly where the problem is in your book. In this book, the chapter that contains the error is chapter 35, which has been titled “Your Chapter.” If you saved a chapter before giving it a title, this URL will have the randomly generated slug instead of the chapter’s title.
(26,268): The last piece of data from this URL is the exact line and character the error occurs at in your EPUB file’s HTML. If knowing the chapter didn’t help you find the error and you need to pinpoint its exact location in the book, we suggest using the ebook management application Calibre to view your EPUB file. While in “edit” mode Calibre interface lets you see the exact line and character of the HTML for each chapter in your EPUB file.
‘http://bit.ly/btb-v042″>http://bit.ly/btb-v042’ is not a valid URL: This is an example of an RSC-020 error, which states that a URL in your book is not valid. The RSC code from the beginning of the error log entry will always correlate to the type of error you’re receiving; the information that comes after the error URL will always describe what the error is about.
PDF files tend to have fewer validation errors than ebook files. Because PDFs are static documents, meaning they always look the same for every device and user, they’re not as sensitive to errors and may export fine despite issues in your EPUB files. However, errors still sometimes occur.
PDF validation logs will appear in your email inbox with the subject line: Pressbooks\Modules\Export\Prince\Pdf
Below is an example of what a PDF validation log may look like.
[time] => Tue Sep 19 01:09:21 2017
[user] => tmcgrath
[site_url] => https://yourbooktitle.pressbo
[blog_id] => 64631
[theme] => Adunis
[url] => http://yourbooktitle.pressboo
Mon Sep 18 21:09:16 2017: —- begin
Mon Sep 18 21:09:20 2017: page 163: warning: no font for Emoticons character U+1F609, fallback to ‘?’
Mon Sep 18 21:09:21 2017: finished: success
Mon Sep 18 21:09:21 2017: —- end
How to Read a PDF Validation Log
The PDF validation log is straight forward; you’ll see the date stamps for the beginning, the flagged errors, the successful finish, and the end of the process. The only part you’ll need to look at is the error.
Find an error by looking for the word “warning”. Each warning will begin with a timestamp. Afterward, you’ll see a description of the error. For the example above, on page 163, the PDF converter was unable to find a font in the file that supplied the emoticon character entered by the user.
To solve an error like the one above, a user can find the page number from the error report, go to its chapter in Pressbooks, and remove the emoticon that caused the problem. Use the error report to figure out the type of error and its location in your PDF file.
SASS errors report problems with your book’s CSS (cascading style sheet). SASS errors appear in your email inbox with the subject line: SASS Error
Below is an example of what a SASS error may look like.
[time] => Sun Dec 9 23:44:51 2018
[user] => mcgratay
[site_url] => https://yourbooktitle.pressbooks.com/wp
[blog_id] => 112926
[Exception] => Array
[error] => unclosed block: failed at `` (stdin) on line 49
[file] => /srv/www/pressbooks.com/releas
[line] => 128
[trace] => #0 /srv/www/pressbooks.com/releas
How to Read a SASS Validation Log
The important part of the SASS error is the information that comes after:
In the example above, the error in the CSS is an "unclosed block." The error log states that the block has failed on line 49. You can go into your CSS, find line 49, and modify the CSS to resolve the error. With this error, the user forgot to add a closing bracket "}" to their custom styles. After the user adds the closing bracket, the error will disappear in future exports.