News for hackers. Stuff that matters.
Re:PhantomJS: Stepping down as maintainer by demonshalo on Thursday April 13, 2017 @06:33AM (#14105662)
A great example would be PDF generation for things like invoices. Rather than generating a pdf with something like PHP or Java. Render a regular html page with all the css you want (super easy compared to drawing a PDF using PHP) and then proceed to use a pdf printer on that page.

You could run such a thing as a microservice using a headless browser or PhantomJS. There are probably better ways to do this but that's one of the first things that popped into my head!

Re:PhantomJS: Stepping down as maintainer by tjelen on Thursday April 13, 2017 @06:48AM (#14105727)
The Webkit/PhantomJS PDF export actually supports SVG embedding (as real vectors), Webfonts and many other things.

It's possible to create pretty advanced layouts with maps, graphs using that. Even embedding IFrames with e.g. Google Maps works.

Re:PhantomJS: Stepping down as maintainer by asdfgadsfgasfdg on Thursday April 13, 2017 @08:58AM (#14106404)
This sounds horrible.. In general all these html->pdf ways of generating pdfs sounds horrible -- why don't people use latex for this?
Re:PhantomJS: Stepping down as maintainer by SigmundA on Thursday April 13, 2017 @10:10AM (#14107030)
Because you probably already did the layout work in HTML to display on screen to the user and now just want a PDF version of it.

Or you can redo the layout in latex and maintain two layouts.

The full print css is actually pretty complete, problem is the only browser that fully supports it is PrinceXML. None of the major browsers seem to care much about print layout.

Re:PhantomJS: Stepping down as maintainer by asdfgadsfgasfdg on Thursday April 13, 2017 @11:01AM (#14107525)
But HTML layout is very different to page based layout. HTML is responsive and has no concept of pagination. PDF is paginated and has no concept of responsiveness.
Re:PhantomJS: Stepping down as maintainer by IneffablePigeon on Thursday April 13, 2017 @12:36PM (#14108547)
CSS2 has the concept of paged layouts: https://www.w3.org/TR/CSS2/page.html
Re:PhantomJS: Stepping down as maintainer by demonshalo on Thursday April 13, 2017 @09:10AM (#14106483)
It is NOT horrible. However, Latex is another way of doing things. Perhaps your requirements should dictate which of the two you should go for!