![]() |
#1 |
Enthusiast
![]() Posts: 25
Karma: 10
Join Date: Apr 2019
Device: Onyx Boox Note 3
|
Remove blank pages
I hope, I post this below now in the correct forum ...
While formatting an ePub with pictures in Sigil (v. 1.9.2), after saving, I see before and after many images empty pages ( in the ebook-viewer of Calibre and in the viewer of my Boox Note 3 E-Ink tablet). However, they are not shown in Sigil, and I do not find those pages in the code. I created the ePub with Calibre and in Sigil I put at the end of each chapter a "split at cursor". To keep the images at screen size I used also "split at cursor" between text and image at the beginning and the end. Sigil shows it me correctly as I want it, the images have their own page and no blank pages are shown. Nonetheless, they are there in the eBook viewers. So how can I get rid of those blank pages? If for help some code is needed, please tell me which part I shall post. |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Split at cursor is just a FLAG to Sigil where to break up the file when you press F6 (do the splitting).
Other than that, it will just show as a Horizontal Rule (a line) everywhere. Margin-bottom (and top) are common causes of a blank page following. You are not done rendering a block, until everything has been satisfied, so if you have a margin-bottom specified after a full screen image, you get another (blank) screen. Style (inline) or CSS: Page-Break-Before (or After) will do it |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,741
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Are these full screen images or are they just images that fit in with the text?
Also, can you show us the CSS and the relevant HTML code? |
![]() |
![]() |
![]() |
#4 | |||
Enthusiast
![]() Posts: 25
Karma: 10
Join Date: Apr 2019
Device: Onyx Boox Note 3
|
Quote:
Quote:
And this is what I did after reading your reply: In the page_style.css I have set margin values to zero: @page { margin-bottom: 0; margin-top: 0 } In the stylesheet.css I have also set to zero everywhere where a margin-top and a margin-bottom appear. I saved it, but at checking the new ePub with my readers, the empty pages still appear. Quote:
Regards, Gunivortus |
|||
![]() |
![]() |
![]() |
#5 | |
Enthusiast
![]() Posts: 25
Karma: 10
Join Date: Apr 2019
Device: Onyx Boox Note 3
|
Quote:
This is the code of a html page with such a picture: --------------------------------- <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" lang="" xml:lang=""> <head> <title>index</title> <meta name="generator" content="pdftohtml 0.36"/> <meta name="date" content="2022-05-20T13:28:03+00:00"/> <link rel="stylesheet" type="text/css" href="stylesheet.css"/> <link rel="stylesheet" type="text/css" href="page_styles.css"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> </head> <body class="calibre"> <p class="calibre1"><a id="p6"></a><img src="index-6_1.jpg" alt="Image 2" class="calibre2"/></p> </body> </html> --------------------------------- Just a note.... all pictures in the PDF were png files. Obviously, Calibre changed them to jpg files (and gave them another name). This is the page_styles.css: ---------------------------------- @page { margin-bottom: 0; margin-top: 0 } @font-face { font-family: "Times New Roman"; panose-1: 2 2 6 3 5 4 5 2 3 4; src: url(fonts/Times-New-Roman.ttf) } @font-face { font-family: "Times New Roman"; panose-1: 2 2 8 3 7 5 5 2 3 4; src: url(fonts/Times-New-Roman-Bold.ttf); font-weight: bold } @font-face { font-family: "Times New Roman"; panose-1: 2 2 5 3 5 4 5 9 3 4; src: url(fonts/Times-New-Roman-Italic.ttf); font-style: italic } @font-face { font-family: "Times New Roman"; panose-1: 2 2 7 3 6 5 5 9 3 4; src: url(fonts/Times-New-Roman-Bold-Italic.ttf); font-weight: bold; font-style: italic } --------------------------------- And this the stylesheet.css: --------------------------------- ody { widows: 1; orphans: 1; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; text-align: justify; } img { max-height: 100%; max-width: 100%; } .cover { text-align: center; text-indent: 0; height: 100%; } .calibre { display: block; font-family: "Times New Roman", serif; font-size: 1.29167em; line-height: 1.2; padding-left: 0; padding-right: 0; margin: 0 5pt } .calibre1 { display: block; margin: 1em 0 } .calibre2 { height: auto; width: auto } .calibre3 { font-weight: bold } .calibre4 { font-style: italic } .calibre5 { display: block; font-size: 1.54839em; font-weight: bold; line-height: 1.2; margin: 0.67em 0 } .calibre6 { display: block; list-style-type: disc; margin-bottom: 0; margin-right: 1em; margin-top: 0 } .calibre7 { display: list-item } .calibre8 { display: block; list-style-type: circle; margin-bottom: 0; margin-right: 0; margin-top: 0 } ---------------------------------- You see, I added your piece of CSS. Kind regards, Gunivortus |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
![]() ) It is NOT the Body margin, but the P or Div that wrap the img tags that can push things. Keyword: Box Model. Epub is boxes within boxes. Body is the chapter (file) outer layer. Each P is a box. Each Div is a box. they all get stacked inside the surrounding box (if nested) body containing many P boxes is the simplest |
|
![]() |
![]() |
![]() |
#7 | |
Enthusiast
![]() Posts: 25
Karma: 10
Join Date: Apr 2019
Device: Onyx Boox Note 3
|
Quote:
(And that's extraordinary, because I am a Dutch). :-) Obviously, by doing these things with Sigil I seem to overreach myself. Anyway, thanks for trying to help me. Regards, Gunivortus |
|
![]() |
![]() |
![]() |
#8 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,741
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Change the following and see how it goes.
Code:
<body class="calibre"> Code:
<body> Code:
<p class="calibre1"> Code:
<p class="cover"> Last edited by JSWolf; 05-20-2022 at 06:16 PM. |
![]() |
![]() |
![]() |
#9 | |||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
For a quick hack, you could change: Code:
img { max-height: 100%; max-width: 100%; } Code:
img { max-height: 98%; max-width: 98%; } * * * Side Note: You may also want to adjust your: Code:
<p class="calibre1"><a id="p6"></a><img src="index-6_1.jpg" alt="Image 2" class="calibre2"/></p> Code:
<div class="image"><a id="p6"></a><img alt="" src="index-6_1.jpg"/></div>
Quote:
The reading system tries to generate a page. Let's say it's 100 units high:
When you do that 98% hack I mentioned above, that may make the entire image fall below that limit... hence, no automatic page breaks. Side Note: Why? When you tell your image to be "100% height"... there's no such thing in HTML. It's undefined. All devices/programs deal with this in slightly different ways, with little quirks/edge-cases. (This same blank-page-around-images issue has been written about a bajillion times over the years, even going way back to 2011! Jellby has written a lot about this topic.) A similar situation even happens when trying to vertically center text in the screen! Quote:
Now that you've posted your code, CSS Page Breaks weren't your problem. * * * Side Note: But what does the CSS for before/after page breaks actually do? They add page breaks! Example HTML: Spoiler:
This says to ALWAYS put a page break before the <div>: CSS: Code:
div.figure { page-break-before: always; } CSS: Code:
div.figure { page-break-after: always; } (If you are familiar with Microsoft Word, this is like you pressing Ctrl+Enter (Insert > Page Break).) Side Note #2: Then, you also have: which is usually used to say: "Try NOT to put a page break here". For example, you may want a whole poem/stanza to stick together: HTML: Spoiler:
CSS: Spoiler:
If a page break just so happens to land between line 1 and 2, you may want to say "Nah, instead, push the entire stanza to the next page. Treat this as one entire chunk if possible." I explained that all in more detail in 2021: "Problems with page breaks/blank pages/line spaces". Last edited by Tex2002ans; 05-21-2022 at 12:07 AM. |
|||
![]() |
![]() |
![]() |
#10 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,741
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
@Tex2002ans, I think the problem is the extra margin space in the CSS. 2em and 10px extra space. Removing this should fix the problem and still let the images be full screen.
|
![]() |
![]() |
![]() |
#11 |
Enthusiast
![]() Posts: 25
Karma: 10
Join Date: Apr 2019
Device: Onyx Boox Note 3
|
Thank you all!
That is a lot of information I can go through and try out! Great! It certainly may cost me some days. Because I do not really understand most if it, I will, illiterate of appropriate CSS knowledge, step by step try all suggestions - it may surprise me. This is the first ePub I ever made myself, maybe the way I followed could be improved. My steps were (all under Windows 10): 1. Write my non-fiction text in LibreOffice, non-formatted, I use LO as it came on my desktop. 2. Put the text in my InDesign 5, formatted it, but without page numbering and added my images at the places they should. 3. Exported it to PDF. (Unfortunately, all png files were converted to jpg). 4. Used Calibre to convert the PDF to ePub. (I do not understand the many setting options Calibre offers for the conversion, so I used standards). 5. Because lots of my wished formatting was gone, I loaded the file in Sigil and tried to get it better formatted again. (Each chapter has to start on a new page, removed line breaks were added again and with your help I've got the pages with pictures only sized well. If there's a better way to go through, I'm open for suggestions and then I do not have problems to pay some for needed software. Thanks again you all! Kind regards, Gunivortus |
![]() |
![]() |
![]() |
#12 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,347
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Step 1: write your book in LO. Use styling - italics and/or bold, etc. Use standardized styles.
SaveAs .docx Step 2: use the Sigil plug-in to import .docx into Sigil. Step 3: use Sigil to clean up anything that needs it. That’s it! Definitely stay away from PDF. It makes an ugly mess and there is no need to use InDesign. That is predominantly/historically for printed books and it doesn’t do so well with epubs. You’d have more to cleanup once you got the file into Sigil. edit: added plugin link Last edited by Turtle91; 05-21-2022 at 08:08 AM. |
![]() |
![]() |
![]() |
#13 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,347
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
I hesitated to enter the conversation earlier... the image solution I use works very well but there are some devices that don't like it...usually older devices. However, if you check and make sure your target market supports it, then using an SVG wrapper around your image is really easy.
SVG wrappers can make your image fill the entire screen and still keep it's proper aspect ratio - it doesn't get stretched or squished. This is awesome if you want a full 'page' graphic rather than something embedded in the text. The image will be placed on it's own xhtml page so there won't be any blank pages before or after it. You can manually create the svg wrapper - I have it set as a Sigil Clip - or you could use the InsertImageSVG plugin to do most of the work for you. If you're manually entering it: put the image on it's own xhtml page and use the following code: Code:
<body> <div> <svg xmlns="http://www.w3.org/2000/svg" height="100vh" width="100vw" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 800 1100" xmlns:xlink="http://www.w3.org/1999/xlink"> <image width="800" height="1100" xlink:href="../Images/SampleImage.png"/> </svg> </div> </body> I highly recommend using an appropriately sized image to start with. If your image dimensions are too small then stretching them to fit large, or high resolution, screens will cause them to look pixelated. Most devices do a decent job with compressing larger images into a smaller screen, so I would err on the side of being too large. Having said that, don't put a 2GB file in there! ![]() Cheers! |
![]() |
![]() |
![]() |
#14 | |
Enthusiast
![]() Posts: 25
Karma: 10
Join Date: Apr 2019
Device: Onyx Boox Note 3
|
Quote:
Kind regards, Gunivortus |
|
![]() |
![]() |
![]() |
#15 | |
Enthusiast
![]() Posts: 25
Karma: 10
Join Date: Apr 2019
Device: Onyx Boox Note 3
|
Quote:
Saved my LO file to DOCX, see: Moderator Notice Oversized image moved to attachment. Pleas follow the guidelines (for images) Then called the plugin to import that DOCX file: Moderator Notice Oversized image moved to attachment. Pleas follow the guidelines (for images) The DOCX file to import was found. Then clicking OK gave an error: Moderator Notice Oversized image moved to attachment Tried it repeatedly. The file is about 1.3 MB. (Pictures not added, would do that in Sigil). What could be the problem? Kind regards, Gunivortus Last edited by theducks; 05-21-2022 at 08:08 PM. |
|
![]() |
![]() |
![]() |
Tags |
blank pages |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Blank pages | Sablerose | Marvin | 11 | 02-08-2014 09:06 AM |
Unwanted blank pages | wdaly | ePub | 8 | 02-27-2013 11:10 AM |
Blank Pages | PAULINE BIRCHNAL | Conversion | 5 | 01-02-2012 12:47 PM |
Troubleshooting one after another blank pages | monsterbadgog | Amazon Kindle | 0 | 02-20-2011 04:02 PM |
Blank pages | JSWolf | Calibre | 4 | 11-29-2008 01:22 PM |