When I saw "... using web technologies" I was curious if it uses Puppeteer. package.json confirms that is indeed the case.
https://github.com/GoogleChrome/puppeteer
(I work for Chrome DevTools team, creators of Puppeteer)
How would that compare to, say, an HTML template + wkhtmltopdf?
Also I feel like the biggest gripe with generating (long) PDFs from HTML are things such as page numbering, orphans and widows, semantically correct word-wrapping, page margins, etc...
Chrome does a decent job but is nowhere close to what LaTeX can do.
Oh how much i would love to have good way how to generate print quality PDFs. The real problem is not hyphenation but how lines are composed. If you want even lines in type set to block then there is probably only Adobe Indesign and LaTeX anything else uses "single line composer" i dont know the algorythm but Latex and Indesign are only ones which take multiple lines into considiration. Latex is sort of Okay but the algorythm in Indesign is still highly superior. I suspect that is some Adobe secret sauce. Pity because you cant run indesign on server, you have it open and use "extendscript" their version of old ECMAScript 3 :(
Seems kind of neat. But for my purposes I will still use Markdown to PDF using pandoc etc.
What really upsets me... the typography still looks shit compared to LaTeX... MS Word / LibreOffice can do better. Would rather stick with plaintext again.
How does this improve upon Pandoc?
https://i.imgur.com/tMkMjNV.png
In the image, ConTeXt generates PDFs. The EA box represents HTML documentation exported from Enterprise Architect, but could be any structured document that pandoc can parse. The source repository contains various themes for the final PDF.
Using ConTeXt offers several compelling features, such as: citations, cross-references, and ability to produce EBPUBs.
This is neat, but perhaps switching the final typesetting engine from chromium's PDF printer to LaTex (via Pandoc maybe) would make it more useful. You'd get more control over things like page numbering and TOCs, plus good justification/microtypography, which is important to most publishers.
Related, why doesn't anyone ever mention [Apache FOP](https://xmlgraphics.apache.org/fop/) for this kind of thing? I've had great success with it.
Waiting to see an example with footnotes and auto references ;)
This looks nice - as a regular latex user, I'd say it (latex) sits roughly between excruciating agony and the actual worst thing in the world.
So the beginnings of an alternative looks great!
How do we pronounce this? Re-LACKED?
All I want is a system that gets the basic right and is version-controllable in git (plain text source code). Latex is just ridiculously complex and inconsistent. Even after years of using it, I have to google how to do most things every time. I would prefer a simple PDF generator that uses pug/HTML (which I know by heart) any day.
https://github.com/bramstein/typeset
This is an implementation of the line breaking algorithm used in TeX in Javascript. It would be nice to add to obtain better typographic results with justified text.
Looks like the perfect solution to my resume. The latest iteration is in HTML/CSS, because it allowed me to easily get the exact layout I wanted (so painful in LaTeX...), but getting a consistent PDF was a challenge.
I produce all my PDFs with pandoc's markdown and in-line html: letters, slides and papers with citations. Depending on whether I need mathjax I use wkhtmltopdf or chromium (JS-based hypens with Hyphenopoly) or just http://weasyprint.org/ if no JS is involved.
This pug language seems to be a good alternative to intermixed markdown+html.
I find Markdown most natural for writing because I do not have to worry about formatting or syntax.
Currently I deliver ~2 PDF reports per week using Ulysses or MacDown for content creation (distraction-free writing), and then typesetting everything into InDesign.
Thank you for creating this tool, I will try it next week.
The ability to render Markdown to Pug as an "Import Markdown" feature would be key for many people to adopt this.
Really beautiful stuff!
I'm in the process of launching BreezyPDF.com which can generate equally as wonderful PDFs from the HTML/JS/CSS you're already using.
Here's a demo of turning a complex dashboard into a PDF: https://ruby.demo.breezypdf.com
How does this compare with Prince?
Not sure if this is related to the format of the PDF somehow, but my computer completely froze when trying to open the Alice pdf in the GitHub viewer. This is on Safari, Chrome was fine.
Interesting project! Can this be used to potentially include JavaScript in resulting PDF files and use them to animate images in the PDF?
This would be useful for some presentations I think.
Given that some of the usecases are to print books, and that this internally uses HTML and CSS< would there be an officially supported way to publish ePubs?
Very cool. Could standard Latex mathmode be used here?
Looks awesome. Can it use CMYK colors? That is killer feature for print centers.
Does it support things like mathjax? This is a really important question to me.
The examples lack hyphenation, which partly explains the too-variable interword spacing. Is this because Chrome still fails to support hyphenation, unlike, for example, Firefox?
There are other subtle defects, which make these PDFs pretty good, but not high quality.
Here is a brief discussion of some of the shortcomings of web typography, and why we still need to use TeX if we want the most beautiful and easiest to read results:
https://lwn.net/Articles/662053/
All that aside, this is impressive and should be useful to many people.