![]() |
#1 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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? |
![]() |
![]() |
![]() |
#2 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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
|
![]() |
![]() |
![]() |
#4 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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)? |
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
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 |