/    Sign up×
Community /Pin to ProfileBookmark

Save HTML file as PDF

I have a project in which we have a web page with a button which we want to take an HTML file and save it as a PDF file. Is it possible to do this simply with JavaScript? If so, how do I do it? And if I can’t do this with JavaScript, does anyone know of another way to translate an HTML file to a PDF format?

Chris

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@JMRKERMar 30.2017 — May be other ways, but if you have Windows 10

1. Right click mouse --> "Save page as"

2. Choose HTML to PDF option.
Copy linkTweet thisAlerts:
@rootMar 30.2017 — You can also use the print option in google chrome or if you need a PDF generated another way you can get a PDF print driver that installs as a printer that you send print jobs to and the result is a PDF file or you can do it server side with a PHP library or functions.

PDF book: http://php.net/manual/en/book.pdf.php

functions: http://php.net/manual/en/ref.pdf.php
Copy linkTweet thisAlerts:
@alana_oFeb 14.2021 — The discussion is rather old, but I'd like to give a piece of advice. If you have windows 10 ofc it'll be easier for you, but as for me, it's easier to use additional sources for such purposes, as this one [https://pdfliner.com/form_1099_misc](https://pdfliner.com/form_1099_misc) At least it helped me a lot and saved a lot of time 😃
×

Success!

Help @ccote1 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...