0

I'm completely new to calibre and e-book creation in general. I've converted a large .docx file to ePub format. When I browse the result with the calibre e-book viewer there is sometimes a "blank page" between the end of one chapter and the start of the next chapter, i.e., I have to press PageDown twice instead of once to get to the next chapter. This worries me; I'm thinking the customer will consider this to be a formatting error, and result in negative feedback.

The location of these extraneous "blank pages" depends on the size of the viewer window, which makes it difficult to debug the situation.

In my Word document I end each chapter with a page break, so the end of a chapter may look like this:

enter image description here

When I look in the ePub file with calibre's file editor, I see this:

    <p class="block_6">When the barman arrived Piotr waved him away. “I have changed my mind, it is time for me to go.”</p>
    <p class="block_6">Paul said, “Let us drive you home.” He got his wallet out and gave Piotr $200. When Henriette reached for her backpack Paul said to her, “No, no, expense account, remember?”</p>
    <p class="block_7" id="calibre_pb_14"> </p>
</body></html>

Now, if I delete the second-last line, the one with id="calibre_pb_14", this seems to "fix" the problem of there sometimes (depending on the viewer window size) being an extra "blank page" between this chapter and the next one.

But maybe that second-last line is needed for some functionality? Or maybe I'm doing something stupid somewhere? Can this problem be fixed, or should I ignore it?

EDIT

Sorry, but I've come to the conclusion that my question is in error. That second-last line represents an actual blank line in the .docx file. I had removed it from the Word document, but apparently failed to successfully replace the book in calibre's book library.

2
  • Which reading system are you testing this on? Apr 6, 2019 at 17:15
  • @idiotprogrammer So far I'm only using calibre's own viewer program.
    – RenniePet
    Apr 6, 2019 at 17:25

2 Answers 2

0

I don't use calibre to produce ebooks, but you should be looking at the css file. My guess is that p.block_7 has some code to force a page break. You can probably fix the problem in two ways -- by removing the blank p tag with the corresponding css or changing the css file itself. Here's code from my recent css file to see what live code looks like.

  p.centeredpagebreak {
     text-align: center;
     font-size: 1.2em;
     page-break-before: always;
     }

MORE about CSS

As you can guess there are also options to do page-break-after and to specify "never" instead of always. By the way, support for this css declaration is flaky; it varies on which reading system you're testing on. IIRC, Google Play Books doesn't support that.. Depending on the device and the context, sometimes Even Kindle doesn't always render it properly.

Answer 2: Like I said, I don't use MS Word/Calibre to format ebooks. But my guess is that if you use the HEADING style for each chapter, you don't need to include a page break in the MS Word file; Calibre will just assume that for every section with a HEADING style, it should insert a page break. Try this suggestion first before trying to mess with the css.

1
  • Calibre is a powerful program and can do lots of things, but it sets reasonable defaults which often must be overridden. Removing the page break will probably fix your problem. Apr 6, 2019 at 17:27
0

I had removed it from the Word document, but apparently failed to successfully replace the book in calibre's book library.

A subtle but important point you made. Be careful when editing source documents that you have converted to ebooks with Calibre. You might think when you go to re-convert after making and saving the edit, Calibre will recognize the updated file version and convert that. Not so in my experience. It's either caching the old version (but I can't find that anywhere if so), or it is reading the metadata of the Word file, which hasn't materially changed, so it says, 'oh, must be the same file as before, just keep it as is.'

Best bet is to delete the book altogether from your Calibre library, then after making the edits in Word, drop the Word doc back into Calibre and convert again. Obviously, it's much faster just to make the change in the epub directly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.