Skip to content

Instantly share code, notes, and snippets.

@JulianLlanten8
Forked from billgeek/PDFMake Sample.html
Created October 28, 2022 20:48
Show Gist options
  • Save JulianLlanten8/1f1ea1e77da3320da153070268d646d5 to your computer and use it in GitHub Desktop.
Save JulianLlanten8/1f1ea1e77da3320da153070268d646d5 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.56/pdfmake.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.56/vfs_fonts.js"></script>
</head>
<body>
<script type="text/javascript">
function downloadPdf() {
var docDefinition = {
content: [
{text:"This is a sample text."}
],
defaultStyle: {
}
};
pdfMake.createPdf(docDefinition).open();
}
</script>
<button onclick="downloadPdf()">PDF with your code</button>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment