4 ms·
This is interesting. Tried loading some ancient DVI files of mine, but as noted in the README they did not work because of the missing Renderer=OpenType. How d
by AlbertoGP 4y ago
This is interesting. Tried loading some ancient DVI files of mine, but as noted in the README they did not work because of the missing Renderer=OpenType.
How does this compare to PDF.js? I mean, if I have a LaTeX document and wanted to display it in this way, would you recommend generating PDF and using PDF.js, or generating DVI and using DVI-decode?
Suggestions for the UI:
- show some indication that the file is loading or rendering.
- display the error messages not just on the console but also on the UI. I mean things like “Uncaught (in promise) Error: Bad DVI file: OpenType renderer option not found for font cmbx12:, try adding Renderer=OpenType to font definition in the LaTeX source.!”
- williamstein 4y agoVery cool - thanks for creating this. I just had a glance at the code, and it appears that one advantage over PDF.js is that this codebase seems to be around 1% of the size of PDF.js. That said, playing with the demo it seems like PDF.js is significantly faster and more robust.
- AlbertoGP 4y agoOh, please note that I did not create this or submitted the story, I just commented on it. Regardless, thanks for the comparison with PDF.js; having a useful document viewer with a small code base is a great feature. I’m interested in using this for preview when writing documents so I can control the document generation and robustness is not as required. The speed would be something to investigate, which again is much easier on a small code base.
- matjphn 4y agoThe author here. Thanks for trying out dvi-decode. I've not used PDF.js before - does it guarantee typesetting accuracy? That is what I wanted to achieve with dvi-decode. The dvi format uses the same units of measurement as used internally by TeX/LaTeX, and the decoding algorithms are very careful to avoid accumulated rounding errors when converting to pixels, so display at high resolution should be very accurate. I will look at improving the demo experience. Note that the demo is running dvi-decode in browser - better perfomance could be achieved by running on a node.js server.