Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
JsPDF generates PDF documents using pure JavaScript
(
code.google.com
)
76 points
by
nreece
on April 23, 2009
|
hide
|
past
|
favorite
|
13 comments
nreece
on April 23, 2009
|
next
[–]
Here's a basic example:
http://jspdf.googlecode.com/svn/trunk/examples/basic.htm
invisible
on April 23, 2009
|
prev
|
next
[–]
I love that they use data: and I've never thought to do that for something as simple as a PDF (which can be really simple). Kudos to the developers!
ciupicri
on April 23, 2009
|
prev
|
next
[–]
The trick consists in generating a
data:application/pdf;base64
URL, which unfortunately can't be too long for practical reasons.
qeorge
on April 23, 2009
|
prev
|
next
[–]
That's really impressive. The syntax seems very similar to FPDF, which is great.
chanux
on April 23, 2009
|
prev
|
next
[–]
Good one.
Off to think what are the practical uses
gourneau
on April 23, 2009
|
prev
|
next
[–]
I should have not been, but I was startled that this could be done with js alone.
tezza
on April 23, 2009
|
prev
|
next
[–]
Do away with JS and just use Java
http://www.lowagie.com/iText/
arnorhs
on April 23, 2009
|
prev
|
next
[–]
wow, very impressive. What about images and such?
jonursenbach
on April 23, 2009
|
parent
|
next
[–]
var putImages = function() { // TODO }
Doesn't look like it supports images yet.
ajm
on April 23, 2009
|
root
|
parent
|
next
[–]
Verified by
http://code.google.com/p/jspdf/issues/list
zackattack
on April 23, 2009
|
prev
[–]
This is pretty freaking awesome. Unfortunately when I click "Run Code" on the demo, it doesn't open/properly save, using Firefox.
jlangenauer
on April 23, 2009
|
parent
[–]
It works for me in Google Chrome (though you hope it would). I'm continually astounded at what can be achieved in Javascript... Will have to have a look at the source tonight and see what I can learn.
fiaz
on April 23, 2009
|
root
|
parent
[–]
Does it work in Rhino? This would be very handy to embed in some Java apps.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: