Skip to content

Instantly share code, notes, and snippets.

@royletron
Created August 21, 2014 13:50
Show Gist options
  • Save royletron/6d47fccf60ef19a65336 to your computer and use it in GitHub Desktop.
Save royletron/6d47fccf60ef19a65336 to your computer and use it in GitHub Desktop.
jsPDF test
<html>
<head>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1-rc2/jquery.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jspdf/0.9.0rc1/jspdf.min.js"></script>
</head>
<body>
<a id="button">Hello</a>
</body>
<script>
$(function(){
$('#button').click(function(){
var doc = new jsPDF('landscape');
doc.text(20, 20, 'Hello landscape world!');
doc.save('Test.pdf');
});
});
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment