Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 08-29-2020, 04:22 PM   #1
gogu1904
Connoisseur
gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.
 
Posts: 80
Karma: 2112464
Join Date: May 2019
Device: Kobo Aura One LE
ebook-convert problem with page_styles.css

Hello,

I use Calibre command lines with path correctly set. I am using ebook-convert and ebook-meta. I wish to get margins set to zero, remove font-family and get rid of the size descriptor from the @page rule in page_styles.css.

With ebook-convert when converting epub to epub, all is fine. But with ebook-convert when converting from html (generated from docx) to epub, the page_style.css file is not modified. With the same set of parameters.

In order to be able to modify the page_styles.css I need to work with --extra-css option (when converting from html to epub). Thus I can set the margin-top and margin-bottom descriptors to zero and add margin-left and margin-right. But I cannot remove the size descriptor. I can replace it to size: auto, but I do not know if this is all right.

These are the options I use:

ebook-convert epub->epub:
--margin-top 0 --margin-bottom 0 --margin-left 0 --margin-right 0
--remove-paragraph-spacing
--filter-css font-family,color,margin-left,margin-right,margin-top,margin-bottom

ebook-convert html->epub:
--margin-top 0 --margin-bottom 0 --margin-left 0 --margin-right 0
--remove-paragraph-spacing
--filter-css font-family,color,margin-left,margin-right,margin-top,margin-bottom
--extra-css page_styles.css

And page_styles.css is:

@page {
margin-left: 0;
margin-right: 0;
margin-bottom: 0;
margin-top: 0;
orphans: 0;
widows: 0;
size: auto;
}

Do you have an idea why ebook-convert works differently in the two cases, even with the same target? Where is my error?
gogu1904 is offline   Reply With Quote
Old 08-29-2020, 05:07 PM   #2
gogu1904
Connoisseur
gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.
 
Posts: 80
Karma: 2112464
Join Date: May 2019
Device: Kobo Aura One LE
I just verified the DOCX to ePub pathway. Curiously, the direct process, DOCX to ePub, works correctly.
gogu1904 is offline   Reply With Quote
Advert
Old 08-29-2020, 10:12 PM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,343
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That's because your input html file will have those. And filtering doesnt apply to @page rules. Dont convert via HTML, for best results convert docx directly
kovidgoyal is online now   Reply With Quote
Old 08-30-2020, 02:43 AM   #4
gogu1904
Connoisseur
gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.gogu1904 ought to be getting tired of karma fortunes by now.
 
Posts: 80
Karma: 2112464
Join Date: May 2019
Device: Kobo Aura One LE
Thank you indeed.

On a different note, is the parameter --language necesary with ebook-convert, or in case of a DOCX conversion it can be taken from the language attribute of the actual text (via the Language option in the Review ribbon)?
gogu1904 is offline   Reply With Quote
Old 08-30-2020, 03:34 AM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,343
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I dont recall, I would guess yes it will use metadata from the docx file to set language. Try it and see.
kovidgoyal is online now   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ebook-convert appending unruly style properties to custom CSS classes johnstephens Conversion 2 10-11-2018 01:59 PM
when does calibre add/not add page_styles css cybmole Calibre 5 07-14-2014 03:58 AM
ebook-convert and Kindle guid problem aschiller Conversion 1 07-24-2012 02:59 AM
Problem with covers converting from ePub to MOBI using ebook-convert Diego Conversion 6 06-01-2011 02:18 PM
ebook-convert HTML to EPUB and problem with <pre><code> mikegr Calibre 2 03-09-2010 02:27 PM


All times are GMT -4. The time now is 10:39 PM.


MobileRead.com is a privately owned, operated and funded community.