Live data from Hacker News

Pdfmake – PDF printing in pure JavaScript

pdfmake.org

1–10 of 49 posts

Re: Pdfmake – PDF printing in pure JavaScript

#2
Just 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

#4
post #2

Just 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?

Agreed on the LaTeX front. The best part is that it's native and cross-platform on the backend, but there also exist libraries to render client-side in JS, though I can't say I've used any of them.

Re: Pdfmake – PDF printing in pure JavaScript

#6

How does it compare to Mozilla's PDF.js https://mozilla.github.io/pdf.js/ or Parallax's jsPDF https://parall.ax/products/jspdf

PDF.js is a Portable Document Format (PDF) viewer.

jsPDF prints using:

    var doc = new jsPDF();
    doc.setFontSize(40);
    doc.text(35, 25, "Paranyan loves jsPDF");
    doc.addImage(imgData, 'JPEG', 15, 40, 180, 160);
Pdfmake on the other hand:

   var dd = {
	content: [
		'First paragraph',
		'Another paragraph, this time a little bit longer to make sure, this line will be divided into at least two lines'
	]
   }

Re: Pdfmake – PDF printing in pure JavaScript

#7
post #6

How does it compare to Mozilla's PDF.js https://mozilla.github.io/pdf.js/ or Parallax's jsPDF https://parall.ax/products/jspdf

PDF.js is a Portable Document Format (PDF) viewer . jsPDF prints using: var doc = new jsPDF(); doc.setFontSize(40); doc.text(35, 25, "Paranyan loves jsPDF"); doc.addImage(imgData, 'JPEG', 15, 40, 180, 160); Pdfmake on the other hand: var dd = { content: [ 'First paragraph', 'Another paragraph, this time a little bit longer to make sure, this line will be divided into at least two lines' ] }

jsPDF doesn't trim each line like Pdfmake does. Pdfmake however supports new pages, witch jsPDF doesn't. Would be cool if Pdfmake didn't trim the lines!

Re: Pdfmake – PDF printing in pure JavaScript

#9
post #6

How does it compare to Mozilla's PDF.js https://mozilla.github.io/pdf.js/ or Parallax's jsPDF https://parall.ax/products/jspdf

PDF.js is a Portable Document Format (PDF) viewer . jsPDF prints using: var doc = new jsPDF(); doc.setFontSize(40); doc.text(35, 25, "Paranyan loves jsPDF"); doc.addImage(imgData, 'JPEG', 15, 40, 180, 160); Pdfmake on the other hand: var dd = { content: [ 'First paragraph', 'Another paragraph, this time a little bit longer to make sure, this line will be divided into at least two lines' ] }

Well, I have used PDF.js and it is great. I think it also has printable option.
Post reply on HN