FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
all
allsaveAsPDF
Remix of iamseeley/savePDF
Public
Like
saveAsPDF
Home
Code
2
README.md
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
README.md

🗃️ save your html as a pdf using html2pdf

// Adjust the options html2pdf(element, { margin: 0.2, filename: 'resume.pdf', image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2 }, jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' } })

usage

<!-- Add the button to your html --> <body> <button id="saveAsPDFButton">Save as PDF</button> <!-- Import the module --> <script type="module" src="https://esm.town/v/iamseeley/savePDF"></script> </body>
Code
README.mdmain.tsx
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.