![]() |
#1 |
Pain in the arse
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
|
Bad rendering for converted document in Calibre ebook reader
UPDATE: probably it's a viewer bug, see this post.
I converted the attached html document (the bzip file) to an epub document. If I open it with the Calibre ebook reader I can't read anything but two divs. My Kobo has no problems to read it correctly. I have Calibre 1.7 on Linux. EDIT: As Kovid Goyal pointed out, a workaroud is to use the flow mode. Last edited by Lucas Malor; 10-23-2013 at 01:58 PM. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
That html uses javascript to display its contents. Most ebook viewers do not support javascript.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Pain in the arse
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
|
It doesn't use javascript, I can see it with NoScript with JS disabled for the doc.
Last edited by Lucas Malor; 10-14-2013 at 06:10 AM. |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Then it's a magic conspiracy that is preventing it from being displayed in anything except your browser.
|
![]() |
![]() |
![]() |
#5 |
Pain in the arse
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
|
As I previously said, the browser shows me the original document correctly (and Kindle shows me correctly the converted one). It's the Calibre e-book viewer that does not show the converted document correctly. So the magic conspiracy is for Calibre only or for your browser that creates JS for HTML only docs
![]() I attach the converted document as well. Last edited by Lucas Malor; 10-15-2013 at 02:14 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,896
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
|
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
So it wasn't JS, it was some kind of absolute layout markup instead, click the little yellow scroll icon in the top right corner of the viewer and it will work.
|
![]() |
![]() |
![]() |
#8 |
Pain in the arse
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
|
I can confirm the book is displayed well using flow mode.
I purged the html package from useless files and corrected html and css so they pass all w3c validators, and the problem still happens (bad using page mode, good with flow mode). Maybe the ebook reader adds some html tags to divide the html into pages, and this brokes up this document? I re-uploaded the documents, see first post. Last edited by Lucas Malor; 10-20-2013 at 04:29 PM. |
![]() |
![]() |
![]() |
#9 |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,896
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
There is nothing more to do. The book works in flow mode.
|
![]() |
![]() |
![]() |
#10 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Passing w3c validation is meaningless. In order to ensure that your markup display well in ebook readers, you have to ensure it is reflowable. This means not using absolute sizes/positions, tables for layout and so on. If I were you I'd use the filter css conversion options to remove all width position, left, top, height etc css properties during conversion.
|
![]() |
![]() |
![]() |
#11 |
Pain in the arse
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
|
I've found: the problem is caused by position: relative for the div #contenuto. I removed it on line 1365 and re-converted the document, and now it looks fine.
For what I know position: relative is not discouraged by epub 2 specs. Last edited by Lucas Malor; 10-22-2013 at 03:07 PM. |
![]() |
![]() |
![]() |
#12 |
Pain in the arse
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
|
I tried to remove a child div of #contenuto, an I can see now its sibling, but no other divs except the last one, as for the original converted doc. Indeed if you notice you can see the first and last page of the document, even if all the contents are inside #contenuto. I can't say if this is a rendering problem.
Last edited by Lucas Malor; 10-22-2013 at 04:29 PM. |
![]() |
![]() |
![]() |
#13 |
Pain in the arse
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
|
Ok, I've found it and created a very simple testcase: shortly, I think the problem is that Calibre ebook viewer calculates the width of an element summing the widths of all the pages that element spans:
PHP Code:
Notice that if you set #container width to 1000px you can see the second page but not the third, that's why I think the viewer wrongs to calculate the element width. It's not clear why this happens only when #content is relative positioned. Last edited by DoctorOhh; 10-23-2013 at 07:43 PM. Reason: back to php tags |
![]() |
![]() |
![]() |
#14 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
As i said absolute layouts are going to cause problems, they are inherently not reflowable.
|
![]() |
![]() |
![]() |
#15 |
Pain in the arse
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
|
...and as I said before and before, this is a relative positioned element, not absolute.
(Why no ones read me... Am I so boring? Next time I've to add some girl images to my posts) |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Unable to convert from EPUB to AZW3 | jujubox7 | Conversion | 12 | 02-12-2013 01:43 PM |
Unable to convert MOBI to EPUB | bb46970 | Conversion | 6 | 08-21-2011 04:45 PM |
Unable to convert Mobi to Epub | Japes | Conversion | 27 | 07-19-2011 12:14 AM |
Convert azw to epub or pdf? | NLight95 | Calibre | 5 | 06-19-2011 06:04 AM |
[Old Thread] unable to convert ebooks(rtf, txt,lit,html,pdf) to lrf in calibre .4.131 | jackdeth191 | Calibre | 9 | 05-02-2009 02:55 AM |