Replies: 3 comments 4 replies
-
Hi, Interesting topic! I put in my two cents. IMHO, the main point is the support of CSS Paged Media. One can find some great resources (e.g. tools comparison) created by @zopyx on his website https://print-css.rocks/. In itself, Chromium does not fully support CSS Paged Media but Paged.js does a great job to fill in what is missing in Chromium. After that, I think that choosing between two rendering tools compliant with CSS Paged Media is mostly a matter of taste. It also depends on the type of services that you want to build. Personnally, I like playing with Paged.js/JavaScript and Chromium because I can hack it as I want (but this is another topic). |
Beta Was this translation helpful? Give feedback.
-
Hi @castedo, thanks for bringing up this topic in our call and for initiating a further discussion here. You put forward a number of good points I didn't consider in the first place making me review my decission again. One of the reasons I went for paged.js was that I didn't want to have another language (Python) in the stack (we already deal with Javascript in other contexts). Although I would be able to handle Python I have to also consider what skills we have in the team now, and maybe what skills we would need in the future if we run such a stack in production (of journal articles). |
Beta Was this translation helpful? Give feedback.
-
Hi again, I meanwhile played around a little more with Paged.js and WeasyPrint and like to share my experiences. I can see the point of being independent of any particular browser when using Print CSS to generate PDF. However, this wouldn't be my main reason for switching to WeaysPrint. One major reason I stubled upon is the incompatibility between Paged.js as run in the browser with its own CLI tool pagedjs-cli. With the same install package, they come in different versions which are not at the same stage in terms of Print CSS support, i.e. the same CSS produces different results with each of the tools. This renders the browser Paged.js tool essentially useless as a live editor (which was very convenient to have) for developing a layout that later should be rendered by the CLI tool. That said, also WeasyPrint doesn’t have any kind of live view for development purposes as far as I know. With respect to missing math support of WeasyPrint I went for MathJax instead of KaTeX. Mainly because it i general also supports Latex notaion and AsciiMath. I run MathJax as a node module (because I have node installed anyway) in a pre-processing step on my server (or in Docker container) like:
I essentially followed the documentation at MathJax-demos-node. Unfortunately also WeasyPrint has its limits and doesn't support important css features. One thing I stumbled upon is the text orientation when trying to layout a rotated table. This requires I guess we'll find a number of things that work with one tool but not with the other (as we already know from Jats). I'll work with WeasyPrint for now but whether or not it will stay lile that probably denepnds on the future support these tools receive. In general I think the detailed requirements of the task at hand will decide for one or the other. |
Beta Was this translation helpful? Give feedback.
-
One of the topics that came up today is choice of software generating PDF from HTML/CSS, in particular, the choice between Chromium and WeasyPrint. For any specific software package there are many short-term practical and tactical pros and cons depending on the situation. But I will skip writing about that. Below I write about medium-term (this decade) strategic reasons one class of software might be more or less promising than the other.
The first class is the "end-user's browser", such as Chromium. The second class is the "e-printer's browser", such as WeasyPrint. By "e-printer" I mean a service, (automated or semi-automated) that takes some kind of content and produces HTML and PDF formats. In my narrow situation, the content is JATS XML of preprints and journal-article-like research documents.
For an e-printer browser:
For an end-user browser:
These observations I find highly suggestive that in this decade, e-printer services will find the specialized e-printer browsers more useful rather than end-users browser.
Or perhaps I am off. Perhaps end-user browsers will work better for both end-users AND e-printing services? e-printer browsers might never implement JavaScript or other HTML features that maybe are too valuable to give up [1].
Perhaps @CourtBouillon, @JulieBlanc, @fchasen or @SimonSapin want to share opinions on whether general end-user browsers like Chromium or specialized e-printer browsers like WeasyPrint are the best medium-term choice for e-printers.
[1] Note: I am able to render attractive math in HTML without JavaScript using server-side KaTeX instead of MathJax.
Beta Was this translation helpful? Give feedback.
All reactions