SHARE
TWEET

Untitled

a guest May 24th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public captureScreen(id: string) {
  2.     console.log(id);
  3.     const data = document.getElementById(id);
  4.     html2canvas(data).then(canvas => {
  5.       const imgWidth = 208;
  6.       const pageHeight = 295;
  7.       const imgHeight = canvas.height * imgWidth / canvas.width;
  8.       const heightLeft = imgHeight;
  9.       const contentDataURL = canvas.toDataURL('image/png');
  10.       const pdf = new jspdf('p', 'mm', 'a4');
  11.       const position = 0;
  12.       pdf.addImage(contentDataURL, 'PNG', 0, position, imgWidth, imgHeight);
  13.       pdf.save('lijst.pdf');
  14.     });
  15.   }
  16.  
  17.  
  18.  
  19.  
  20. <div class="row justify-content-around mb-3" *ngIf="order.orderId">  
  21.       <h5 >Bestellingscode {{order?.orderId || ""}}</h5>
  22.     <input type="button" class="btn btn-primary" value="Print order" (click)="captureScreen(order?.orderId)" />  
  23.   </div>
  24. <table class="table" attr.id="{{order?.orderId}}">
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top