Skip to content

Instantly share code, notes, and snippets.

@wisnubaldas
Last active October 10, 2019 14:37
Show Gist options
  • Save wisnubaldas/65aa8e0a0e9deb546510fe757830e118 to your computer and use it in GitHub Desktop.
Save wisnubaldas/65aa8e0a0e9deb546510fe757830e118 to your computer and use it in GitHub Desktop.
// source https://jsbin.com

Yeah, This issue I have solved with some trick.

First took the total height of page, using

pageHeight= pdf.internal.pageSize.height;

Then, while adding text into pdf,

pdf.text(x, y, "value");

I am checking this condition everytime,

if (y>=pageHeight) { pdf.addPage(); }

I hope that this will helpful for you.

But still I am unable to find solution for table. I am created table using this js :jspdf.plugin.cell.js. it will create auto-pagging that I don't want. because I did header/footer of jspdf. and my feature not work completely when it comes to table structure. because it's overlap footer/header everytime. I am working on it.

<script id="jsbin-source-html" type="text/html">Yeah, This issue I have solved with some trick. First took the total height of page, using pageHeight= pdf.internal.pageSize.height; Then, while adding text into pdf, pdf.text(x, y, "value"); I am checking this condition everytime, if (y>=pageHeight) { pdf.addPage(); } I hope that this will helpful for you. But still I am unable to find solution for table. I am created table using this js :jspdf.plugin.cell.js. it will create auto-pagging that I don't want. because I did header/footer of jspdf. and my feature not work completely when it comes to table structure. because it's overlap footer/header everytime. I am working on it.</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment