Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public captureScreen(id: string) {
- console.log(id);
- const data = document.getElementById(id);
- html2canvas(data).then(canvas => {
- const imgWidth = 208;
- const pageHeight = 295;
- const imgHeight = canvas.height * imgWidth / canvas.width;
- const heightLeft = imgHeight;
- const contentDataURL = canvas.toDataURL('image/png');
- const pdf = new jspdf('p', 'mm', 'a4');
- const position = 0;
- pdf.addImage(contentDataURL, 'PNG', 0, position, imgWidth, imgHeight);
- pdf.save('lijst.pdf');
- });
- }
- <div class="row justify-content-around mb-3" *ngIf="order.orderId">
- <h5 >Bestellingscode {{order?.orderId || ""}}</h5>
- <input type="button" class="btn btn-primary" value="Print order" (click)="captureScreen(order?.orderId)" />
- </div>
- <table class="table" attr.id="{{order?.orderId}}">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement