Guest User

Untitled

a guest
Jan 16th, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. var pdf = new jsPDF('p', 'pt', 'letter');
  2. pdf.addFileToVFS('CustomFont.tff', 'base64 of .tff file');
  3. pdf.addFont('CustomFont.tff', 'CustomFont', 'normal');
  4. pdf.setFont('CustomFont');
  5. var source = $('#pdf')[0];
  6. var margins = {
  7. top: 50,
  8. bottom: 60,
  9. left: 40,
  10. width: 520
  11. };
  12. pdf.fromHTML(
  13. source,
  14. margins.left,
  15. margins.top, {
  16. 'width': margins.width,
  17. 'elementHandlers': specialElementHandlers
  18. },
  19. function (dispose) {
  20. pdf.save('Test.pdf');
  21. }, margins);
Add Comment
Please, Sign In to add comment