pdfmake icon indicating copy to clipboard operation
pdfmake copied to clipboard

restrict 30 rows per page in a table

Open mpsbhat opened this issue 11 years ago • 6 comments

How can I restrict only 30 rows of html table per page in pdf? ie, Pagebreak after every 30 rows.

mpsbhat avatar May 24 '15 04:05 mpsbhat

When you generate doc definition from html, you can break your table in multiple tables with 30 rows in each.

gnibeda avatar May 24 '15 10:05 gnibeda

But the table rows are generating dynamically from backend code. So is it possible to set row height?

mpsbhat avatar May 25 '15 02:05 mpsbhat

But the table rows are generating dynamically from backend code. So is it possible to set row height?

mpsbhat avatar May 25 '15 02:05 mpsbhat

Hi, can you describe more concrete what you want to achieve?

As @gnibeda pointed out, you can easily create a new table by counting the rows yourself in JavaScript.

jthoenes avatar May 26 '15 18:05 jthoenes

Myself creating a pdf file from html table using pdfmake where there are 25+ columns. So I given A2 pagesize otherwise all the columns not fit inside the document. When I given A2 size, automatically the rows per page will becoming 60+ which is not visible after printing in a hard copy of papersize A4. Attached the screen shot of the report. The code is here: http://jsfiddle.net/mpsbhat/845mkg9h/50/ screenshot from 2015-05-19 14_55_00

mpsbhat avatar May 27 '15 16:05 mpsbhat

I'm still not sure what you want You want to split by 30 rows? Split your reportGrid into chunks of 30 for instance using lodash.

You want to split by 30 columns? That's not supported by pdfmake.

jthoenes avatar May 27 '15 16:05 jthoenes