View Single Post
Old 03-31-2025, 01:27 AM   #1
axu2
Groupie
axu2 reads XML... blindfoldedaxu2 reads XML... blindfoldedaxu2 reads XML... blindfoldedaxu2 reads XML... blindfoldedaxu2 reads XML... blindfoldedaxu2 reads XML... blindfoldedaxu2 reads XML... blindfoldedaxu2 reads XML... blindfoldedaxu2 reads XML... blindfoldedaxu2 reads XML... blindfoldedaxu2 reads XML... blindfolded
 
Posts: 174
Karma: 52202
Join Date: Jun 2023
Device: Kindle Scribe
[Guide] Fixing Google Docs EPUBs

Google Docs provides an EPUB download option. But it has tons of problems when used on various readers like Apple Books or Kindle.

Specifically:
1) extremely weird image formatting/squishing (presumably due to Google Docs being fixed layout.)
2) the colors looking terrible on eink, especially if the google doc has a background color
3) and more...

The other download options like docx, MD, have even more problems.

So here's how to fix the Google Docs EPUB output so it works well in many readers like Kindle, iBooks, etc. You can set these settings as Calibre default if you want. If you have feedback please share!

* Download EPUB from Google Docs
* Import into Calibre
* Update Title and Author metadata.
* Convert books (in bulk if doing many books)
* Set Output format to EPUB.
* Change these Conversion settings:
** Look and Feel
*** Styling
**** Extra CSS
Code:
img {
  width: auto !important;
  height: auto !important;
  max-width: 100%;
  display: block;
}
This makes all images responsive instead of fixed size like in a Google Doc. display: block adds a line break after images.
*** Filter Style Information
**** Check Colors and font and padding (this removes Google Docs background color/custom fonts)
*** Transform HTML
**** if tag is span remove attribute style
**Page Setup
*** Select tablet output profile at bottom so images aren't reprocessed
** EPUB output
*** Select EPUB 3, default is EPUB 2, so formatting isn't lost.

and finally add your covers. To get calibre to show in library, bulk edit metadata, update cover from e-book file.

Now you have a perfectly formatted epub that looks great in iBooks or Send to Kindle.

Video version (slightly outdated): https://www.youtube.com/watch?v=jWNql6iJbiA

Changelog since video:

1) added remove fonts checkbox to fix changing fonts.
2) don't remove spans entirely, only the inline style. Was accidentally removing bold/underline/italics previously.
3) added remove padding checkbox to fix chapter heading spacing.

Last edited by axu2; 03-31-2025 at 01:29 AM.
axu2 is online now   Reply With Quote