![]() |
#1 |
new to authoring ebooks
![]() Posts: 5
Karma: 10
Join Date: Oct 2020
Device: iPad
|
HTML -> EPUB3 not rendering canvas elements
Hi, I have an HTML page: https://hedges.belmont.edu/classification_exercises/
that has some interactive graphical Javascript elements that use HTML5 canvas. I am interested in rendering this as EPUB3 since EPUB3 includes support for HTML5 and canvas. I saved the file locally from my browser (Chrome: Save As), which saved the html and a directory. This I imported into Calibre which became a ZIP. Then I clicked on Convert books, went down to EPUB Format, and changed the EPUB version from 2 to 3. Then I clicked on "OK" in the bottom right. The conversion happened with out errors I think (log below. there is a mention of a permission error, odd because I installed via flatpak & Pop!_OS's PopShop package manager). But when I view the EPUB file in Calibre, all of the canvas elements are simply blank, and my javascript slider is non-responsive. Can someone advise me on what I need to do to fix this? As I search around for posts involving Calibre, HTML5 and Canvas, I see discussions indicating that Canvas should be supported by Calibre, even the latest release notes (Oct 8) talking about canvas support being fixed (for PDF...interestingly, if I export to PDF the canvas elements are also blank). Thanks very much. I am new to this, so I apologize in advance if there's something obviously stupid I forgot. ;-) Here is the conversion log: Spoiler:
(PS- my selected eReader device in Calibre is iPad/iPhone) Last edited by PeterT; 10-09-2020 at 11:31 PM. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,342
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The calibre viewer is simply chrome. So your canvas and JS elements should work automatically. Open the developer tools in the viewer and look in the console for any errors.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
new to authoring ebooks
![]() Posts: 5
Karma: 10
Join Date: Oct 2020
Device: iPad
|
Oh hey! It's just that the Calibre *VIEWER* won't render these elements!
I imported the EPUB3 file into iBooks on my iPad and the interactive graphs are there! Posted the file here in case someone wants to try: https://hedges.belmont.edu/classific...assy_book.epub |
![]() |
![]() |
![]() |
#4 | |
new to authoring ebooks
![]() Posts: 5
Karma: 10
Join Date: Oct 2020
Device: iPad
|
@kovidgoyal thank you for your reply. I didn't see it before I wrote my reply.
When I look at the Console in Calbre, I see the error: Quote:
vis.js is one of the files in my ZIP. But even when I had brought the js files inside my HTML file so it was just one big file, the canvas element still wasn't rendering in Calibre. |
|
![]() |
![]() |
![]() |
#5 |
new to authoring ebooks
![]() Posts: 5
Karma: 10
Join Date: Oct 2020
Device: iPad
|
@kovidgoyal
I inspected in Calbibre the EPUB generated from the one-big-file version with no imports (which I will post here: https://hedges.belmont.edu/classific...es/classy.html) And after I convert and try to view it in Calibre, no error messages appear on the Developer Tools Console (e.g. the vis.map error is no longer there) , but no canvas elements appear either. ![]() Trying to view the HTML in regular Chrome, it works fine. Also, apparently I misspoke earlier: the iPad renders the first graph ok, but the second appears as blank. :-( Adding log: Spoiler:
Last edited by PeterT; 10-09-2020 at 11:33 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,342
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Figure out what is rendering the canvas in the html page, and insert some code into the epub to call it, probably it is being rendered n some kind of browser event that is not present in the viewer.
|
![]() |
![]() |
![]() |
Tags |
canvas, conversion, epub, html5 |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
MoonReader and html/css rendering | nindotza | Android Devices | 4 | 09-26-2020 04:01 AM |
Sigil output with no html or head elements | pittendrigh | Sigil | 10 | 08-25-2018 08:58 AM |
How to solve EPUB3/EPUB2 rendering issue on Ipad | E-Books | ePub | 2 | 05-16-2013 07:07 AM |
html elements in epub | kamwoj | ePub | 8 | 02-11-2012 05:43 AM |
HTML input -<b> and <i> being converted to block elements? | fluxcore | Conversion | 2 | 02-18-2011 09:36 PM |