In EPUB3 readers with full <canvas> support one can translate the paint primitives via pdf.js into JS, too.