Comments (8)
Guys meanwhile if you are using angular2> you can use it by this way:
1.- Place all the .js in a folder in assets
2.- In the index.html:
<script src="assets/html2pdf/jspdf.min.js"></script>
<script src="assets/html2pdf/html2canvas.min.js"></script>
<script src="assets/html2pdf/html2pdf.js"></script>
3.- In your component at the imports section:
declare var html2pdf: any;
4.- And finally in your needed function:
var element = document.getElementById('card-a4');
new html2pdf(element, {
margin: 0,
filename: 'myfile.pdf',
image: { type: 'jpeg', quality: 0.98 },
html2canvas: { dpi: 192, letterRendering: true },
jsPDF: { unit: 'mm', format: 'a4', orientation: 'p' }
});
from html2pdf.js.
Hey @keshav1007, sure thing, I'm working on it!
from html2pdf.js.
Okay everyone, the NPM package is done and delivered with the new v0.8.0! You can use it with npm install html2pdf.js
(note the .js
in the name, there was already an NPM package named html2pdf
). Enjoy, and let me know if there's any issues!
P.S. As html2canvas points out, even though you can now use NPM/Node to build with this package, it will never work browserless in Node. Any package using html2pdf will need to run in the browser to work properly. You've been warned!
from html2pdf.js.
hey @eKoopmans I hope it is done as npm package, wanna use in my project.
from html2pdf.js.
Hi @eKoopmans is this ready?
from html2pdf.js.
An NPM package would be awesome.
from html2pdf.js.
@azebac thanks for this.. it is working properly but since i have some graphs/charts in my page those are not rendered properly.. do you have any solution for that?
from html2pdf.js.
Okay, stay tuned folks! I'll be dropping a new build in the next few days, rebuilt for NPM and all your require/include needs. Just need to work out the kinks.
from html2pdf.js.
Related Issues (20)
- SVG file in child block didn't get printed
- Request for Assistance: Addressing Text Overlapping Issue with Next.js and html2pdf.js
- Page break "avoid" does nothing at all
- CVE-2020-7691 Security Vulnerability Issue HOT 2
- Broken image after created pdf
- Multiple Page download found slowness while downloading
- Memory is not deallocating for html2pdf even though for small data
- Html2pdf bloburl promise return causing UI stuck and increasing jsheap also
- Checkbox states unexpectedly changing to "on" when generating PDF with html2pdf.js HOT 1
- To add a logo to the PDF page. HOT 1
- Longer page being misaligned on page and truncated at bottom HOT 1
- base64 file not showing on first render - Safari
- Multi Language Support HOT 1
- Hi everyone, PDF content is blank after download in IOS
- Using HTML2PDF, text taking extra space HOT 1
- Date format change from dd-mm-yyyy to yyyy-mm-dd
- I want o set both orientation in same pdf
- page break in between text line while convert html to pdf HOT 3
- Can I get the progress bar example source? HOT 1
- scale issue to generate pdf
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from html2pdf.js.