user1896653
user1896653

Reputation: 3327

How to reduce table size at pdf rendered from html by jSPDF?

There is a table at my html page. I have used jSPDF to convert that html view into PDF. It takes two pages in PDF. So, table header (thead) is showing at both of the pages. I don't want header in second page. So, I think if I could reduce table size (with column line height etc.), it would fit in one page so that there will be only one thead. Also, there will be maximum 12 rows in that table always. That's why, I want to fit the view in one page in the PDF. How to do that?

Fiddle Demo

Upvotes: 0

Views: 1610

Answers (1)

Sanjana Nair
Sanjana Nair

Reputation: 86

I faced a similar issue. Changing the line : var doc = new jsPDF(); to var doc = new jsPDF('portrait', 'pt', 'a4'); solves the problem. The table now fits in a single page as shown here.

Upvotes: 2

Related Questions