Little of topic. What would be nice is to have something like "print to pdf, aka save page as pdf" via a browser using pdfjs.
"PDF" is a valid application-agnostic printer target on the Debian box I am using.
Pdfmake – PDF printing in pure JavaScript
31–40 of 49 posts
Re: Pdfmake – PDF printing in pure JavaScript
#32Just looked at the sample on the playground section of the website. No hyphenation, no ligatures, and overall the output looks ugly (compared to TeX). What is the advantage over simply creating an appropriate LaTeX/ConTeXt document in the background and serving that?
For the same reason everything eventually gets rewritten in Javascript: sometimes you want to do it in a browser. In my case, I have a Javascript app that stores critical information for offline use, and users want to be able to print that information nicely. So I generate PDFs in Javascript. This could make that much easier.
Indeed:
Re: Pdfmake – PDF printing in pure JavaScript
#33Earlier quoted context omitted.
"PDF" is a valid application-agnostic printer target on the Debian box I am using.
In OS X too. I believe Windows is the only OS that needs you to install a PDF printer.
On iOS, Apple disabled the API for local virtual printers. There are various "html-to-pdf" apps, but these often perform a non-interactive fetch of the source web page, which use different auth/cookies and can result in a PDF which is different from the one displayed by Safari.
Re: Pdfmake – PDF printing in pure JavaScript
#34Just looked at the sample on the playground section of the website. No hyphenation, no ligatures, and overall the output looks ugly (compared to TeX). What is the advantage over simply creating an appropriate LaTeX/ConTeXt document in the background and serving that?
Re: Pdfmake – PDF printing in pure JavaScript
#35Just looked at the sample on the playground section of the website. No hyphenation, no ligatures, and overall the output looks ugly (compared to TeX). What is the advantage over simply creating an appropriate LaTeX/ConTeXt document in the background and serving that?
what doesn't!
>What is the advantage over simply creating an appropriate LaTeX/ConTeXt document in the background and serving that?
the obvious advantage is that you wouldn't have to learn LaTeX/ConTeXt, no?
Re: Pdfmake – PDF printing in pure JavaScript
#36Re: Pdfmake – PDF printing in pure JavaScript
#37Earlier quoted context omitted.
But the bus is free and it works fine.
but it comes with schoolbus-type problems and you look ridiculous.
Re: Pdfmake – PDF printing in pure JavaScript
#38Just looked at the sample on the playground section of the website. No hyphenation, no ligatures, and overall the output looks ugly (compared to TeX). What is the advantage over simply creating an appropriate LaTeX/ConTeXt document in the background and serving that?
>overall the output looks ugly (compared to TeX) what doesn't! >What is the advantage over simply creating an appropriate LaTeX/ConTeXt document in the background and serving that? the obvious advantage is that you wouldn't have to learn LaTeX/ConTeXt, no?
In Haskell this is possible with similar DSLs. Very useful to generate reports.
Re: Pdfmake – PDF printing in pure JavaScript
#39Earlier quoted context omitted.
PhantomJS is a full web browser that just happens to output PDF's. This is a library to create PDF's with it's own layout model that shares nothing with HTML. Much simpler and low level.
Is it really simpler? I have to learn a DSL to create PDFs with this, whereas I can just use HTML in the other case.
Simpler as in ease of use? Well that's subjective, some might find HTML easier than learning a new layout model, other might like something more focused on just PDF layout like this.
Re: Pdfmake – PDF printing in pure JavaScript
#40Earlier quoted context omitted.
Is it really simpler? I have to learn a DSL to create PDFs with this, whereas I can just use HTML in the other case.
It's not like there is a direct translation from HTML to PDF. They don't really map 1:1. The PDF exported by a browser from an HTML page is an interpretation of that content. Converting from HTML is not a straightforward, reliable way to produce PDFs. Sometimes the process turns out beautiful, sometimes it turns out kind of shitty. Not to mention there are PDF features which are not supported by an HTML export (for e…
If someone (Apple or Google) would get wise and implement the full paged media spec then PhantomJS/wkhtmltopdf/your browser might be a viable option for full fidelity print output.
See: http://www.webkit.org/projects/printing/
Until then our apps will have to suffer with one layout language for viewing (HTML) and have another for print like this lib.