![]() |
#1 |
Connoisseur
![]() Posts: 62
Karma: 10
Join Date: Mar 2019
Device: Kindle 3 Paperwhite
|
display: block for image converted from docx
Hello,
seems images converted from docx to epub obtain css rule "display: block". Such styling has negative consequences for (at least) inline images: - image no longer appears centered (when centering is achieved by the paragraph format, eventually applaing css rule "text-align: center" to parent paragraph in epub) - image surrounded by text appears with undesirable line breaks before and after the image itself Can I somehow disable this behaviour? So far the workaround for me is to manually edit converted epub – delete rule "display: block" (for class applied to images). |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,258
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No such thing, whether an image gets diplsay block or not depends on how it is styled, and positioned in the original document, see the example at: https://manual.calibre-ebook.com/con...word-documents
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Connoisseur
![]() Posts: 62
Karma: 10
Join Date: Mar 2019
Device: Kindle 3 Paperwhite
|
Hm. Seems the issue is somehow influented by compatibility mode of source docx.
In vanilla docx, inline image is converted as expected. When source docx is set to compatibility mode (docx saved as doc, then saved as docx again, with "compatibility mode" option; Word 2013, 32b, czech localization), inline image is converted as "display: block". Sample docx and epub files attached. On the other hand, original sample docx is in compatibility mode, too. And conversion issue is not detected... Last edited by quinta@ebf.cz; 03-04-2019 at 12:19 PM. Reason: typing error |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,258
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Does not have anything to do with compatibility mode. It depends on how the original image is sized and positioned and styled. The problem is DOCX has no conceyt of block vs inline images, so that has to be guessed based on heuristics. You can always override it for images that get wrongly guessed using th eEdit book tool.
|
![]() |
![]() |
![]() |
#5 |
Connoisseur
![]() Posts: 62
Karma: 10
Join Date: Mar 2019
Device: Kindle 3 Paperwhite
|
Resaving test document without compatibility mode resolves the issue.
Resaving Calibre demo document in compatibility mode causes the issue appears. Following detection method described on https://www.howtogeek.com/256269/wha...rosoft-office/, the compatibility mode versions of tested documents are the same ("Word 97-2003"). There must be some additional difference. Anyway thank You for your assistence. The problem is quite specific and not primarily caused by Calibre. |
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
DOCX to EPUB and Tables are not converted correctly | lbdyck | Conversion | 4 | 01-17-2017 06:27 AM |
Converted file to DOCX is not readable by Word | HagaWaga | Conversion | 1 | 01-28-2016 11:47 AM |
Display block ... why? (Question about CSS and Calibre) | NASCARaddicted | ePub | 7 | 06-23-2013 09:26 PM |
HTML input -<b> and <i> being converted to block elements? | fluxcore | Conversion | 2 | 02-18-2011 09:36 PM |
Code block view (converted from CHM) | Replika | Calibre | 3 | 10-19-2010 02:08 PM |