• by leephillips on 4/30/2018, 4:58:55 PM

    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.

  • by kaycebasques on 4/30/2018, 7:05:23 PM

    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)

  • by Ecco on 4/30/2018, 4:06:27 PM

    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.

  • by omnimus on 4/30/2018, 10:53:19 PM

    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 :(

  • by che371291 on 4/30/2018, 7:12:21 PM

    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.

  • by thangalin on 4/30/2018, 4:42:03 PM

    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.

  • by deleterofworlds on 4/30/2018, 4:58:33 PM

    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.

  • by nateroling on 4/30/2018, 5:34:00 PM

    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.

  • by killercup on 4/30/2018, 4:24:31 PM

    Waiting to see an example with footnotes and auto references ;)

  • by nmca on 4/30/2018, 8:58:46 PM

    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!

  • by foobaw on 4/30/2018, 4:25:16 PM

    How do we pronounce this? Re-LACKED?

  • by felixfbecker on 5/1/2018, 5:47:41 AM

    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.

  • by agussell on 4/30/2018, 9:09:50 PM

    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.

  • by Wehrdo on 5/1/2018, 1:15:54 AM

    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.

  • by Klasiaster on 5/1/2018, 5:54:07 AM

    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.

  • by buildbuildbuild on 4/30/2018, 5:01:10 PM

    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.

  • by deedubaya on 4/30/2018, 6:15:14 PM

    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

  • by williamscales on 4/30/2018, 4:17:06 PM

    How does this compare with Prince?

  • by jakear on 4/30/2018, 5:38:41 PM

    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.

  • by lkurusa on 4/30/2018, 4:52:01 PM

    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.

  • by pritambaral on 4/30/2018, 4:49:56 PM

    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?

  • by wyas on 4/30/2018, 4:07:59 PM

    Very cool. Could standard Latex mathmode be used here?

  • by czechdeveloper on 5/1/2018, 6:31:53 AM

    Looks awesome. Can it use CMYK colors? That is killer feature for print centers.

  • by baby on 4/30/2018, 6:40:06 PM

    Does it support things like mathjax? This is a really important question to me.