https://github.com/hearsid/ng-html-to-pdf-save
Save HTML as pdf file on the browser with angularjs .
https://github.com/hearsid/ng-html-to-pdf-save
angularjs converts html pdf
Last synced: 4 months ago
JSON representation
Save HTML as pdf file on the browser with angularjs .
- Host: GitHub
- URL: https://github.com/hearsid/ng-html-to-pdf-save
- Owner: hearsid
- Created: 2016-04-19T08:14:55.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-09-23T17:27:46.000Z (over 7 years ago)
- Last Synced: 2025-09-22T09:38:44.563Z (9 months ago)
- Topics: angularjs, converts, html, pdf
- Language: JavaScript
- Size: 2.65 MB
- Stars: 28
- Watchers: 3
- Forks: 35
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Angularjs save HTML as PDF in your browser
This is an angularjs module to save HTML as PDF DEMO, it basically converts the HTML to HTML5 canvas and captures the same and converts it to PDF and saves it in your browser .
Here are the steps :
1) bower install angular-save-html-to-pdf
OR
npm install angular-save-html-to-pdf
2) Link the JS files in your HTML file :
```
```
3) Add this module to your angular app :
```
var app = angular.module('app' , ['htmlToPdfSave']) ;
```
4) Use the directives in your app , here is a code snippet from a working copy in demo folder :
```
Hello Someone
Hello Someone
Hello World
Hello World
```
To allow addition of multiple pdf save button and linking them to the pdf save content block every pdf-save-button and pdf-save-content directive is associated with an ID , the pdf-save-button will match the ID with pdf-save-content block and the matching HTML block will be saved .
### Developer instructions:
If you would like to run the project locally, you can download the repo and run :
1)
```
> gulp concat
> gulp compress
```
commands to create the bundled file which is then used in the demo/index.html file.
2) demo/index.html file can be served easily by any static web server to test the project, I use and thus recommend python server which you can start by writing
``` python -m SimpleHTTPServer 9090 ```
9090 can be replaced by your prefered port.
NOTE : This is a new repository and has been tested with basic HTML and google graphs , please create github issues if you find it is not working with something and consider contributing. Cheers .