News for hackers. Stuff that matters.
Re:The Mercury programming language by mpweiher on Thursday November 08, 2018 @03:13AM (#18404983)
I've seen a bunch of these (HTML -> PDF). I've never seen a succinct answer to: "How is this different/better than taking <random web browser> and hitting "print", which at least on OS X will produce a nice PDF?"
Re:The Mercury programming language by bjz_ on Thursday November 08, 2018 @03:39AM (#18405076)
Prince is pretty powerful when it comes to print-specific stuff. We care about pagination, making tables look good across page breaks, footnotes, great justification, table of contents, non-sRGB color space handling, crop marks, etc. Also having great accessibility annotations (often mandatory for government documents). These are things that web browsers are less concerned with - print-to-PDF is more of an afterthought, where as for us it's our main area of focus.
Re:The Mercury programming language by coldtea on Thursday November 08, 2018 @04:38AM (#18405285)
That's not even close to what you get with a good HTML -> PDF export, which can include anything from proper pagination, page margins and TOCs, to orphans handling and other such concerns.
Re:The Mercury programming language by noir_lord on Thursday November 08, 2018 @06:14AM (#18405544)
The Synfony project use princexml to generate their documentation (including The Book) and it's phenomenally good.

https://symfony.com/doc/current/index.html#gsc.tab=0

Select offline, The book, 4.2 and it generates the book on the fly.

Re:The Mercury programming language by lillesvin on Thursday November 08, 2018 @03:26AM (#18405026)
I'm not the guy you asked but I've been using PrinceXML to produce PDFs intended for customers of our client (e.g. invoices, terms and conditions, itineraries, etc.). Sure, we could just display the HTML and let either the customer or the sales agent press "Print to PDF" but it's not very user friendly—non-power users may not know that "print to PDF" is even an option—nor is it particularly practical for batch processing.

Full disclosure: If I'd had my way we would have used LaTeX templates to produce the PDFs but the previous developers had already implemented the HTML->PDF flow, so we just replaced the old, defunct service with Prince, which did a surprisingly good job, IMO.

Re:The Mercury programming language by coldtea on Thursday November 08, 2018 @04:39AM (#18405293)
>Sure, we could just display the HTML and let either the customer or the sales agent press "Print to PDF" but it's not very user friendly—non-power users may not know that "print to PDF" is even an option—nor is it particularly practical for batch processing.

It's not just that. Print to PDF for basic stuff it can be an option. For complex documents, print workflows, etc, it's a non-starter.

Re:The Mercury programming language by justbaker on Thursday November 08, 2018 @09:47AM (#18406550)
> "How is this different/better than taking <random web browser> and hitting "print"

If you have to repeat this process 2000 times, it becomes time consuming. It doesn't scale for a single user needing 2000 pdfs to do the process manually.

Re:The Mercury programming language by posterboy on Thursday November 08, 2018 @11:14AM (#18407250)
You don't know Headless Browser modes. There are a bunch of scriptable CLIs.
Re:The Mercury programming language by justbaker on Tuesday November 13, 2018 @11:07PM (#18447397)
I do know about headless browsers. The comment above mine mentioned a manual process, no scripts or headless browsers. a combo of Curl, wkhtmltopdf(or other html to pdf) and a for loop can perform this in a bash 1-liner.