I'm looking for replace my word-template->java->apachepoi->pdf process by simplier thing and delegate generation to client browser and I discover simple pdfmake and seems nice but this definition makes me scared and maybe limited I could be wrong and I hope be ^^
I wonder is is possible to create someting like that

I mean all my document are TABLE based and 4 or 5 first rows are repeated on each page can we add max width possible for a table , so when table contain only 1 row we can have border of the table until bottom of the document... here in my screenshot you can see what I mean. it is sometims like :
if we finish loop and the table finish at middle of a pdf page jsute continue border with empty content until max bottom possible.
Another question or feature request if we can set header height on only one header-row not specify all height for each row just first or second or third.
We are generating >50 pages docs
awesome work @bpampuch @liborm85
I opened issue july and today Im still looking for library (js based) supports this feature because our curent process word template to pdf using apachepoi is complex. i wonder if psdmake is aim to have this feature and if this ask big effort to achieve
cc @liborm85
I am looking for the similar feature. If this feature takes a lot of effort, as a workaround, if we are able to atleast calculate the remaining height of the page, we can set the height of the last row(required row) of the table to consume the remaining page space using the heights property inside table field.
But as of now, I don't see a way to calculate the remaining height of the page as well. Please correct me if I am wrong. Thanks.
table: {
heights: (currentRow: number) => number | 'auto'
}
Any update on this?
Thanks
The pdfmake module internally maintains a variable which contains all the meta-data such as total page height, current horizontal/vertical position and so on. We are able to achieve this functionality by using that variable.
Following is the code that calculates the padding for the last element using the currentPosition and totalPageHeight which will be equal to the height of the rest of the page.
Set the below created layout to the table.
const TABLE_LAYOUT: CustomTableLayout = {
paddingBottom: (rowIndex: number, node: any, colIndex: number) => {
const DEFAULT_PADDING = 2;
// Calculate padding for the last element of the table.
if (rowIndex === node.table.body.length - 1) {
const currentPosition = node.positions[node.positions.length - 1];
const totalPageHeight = currentPosition.pageInnerHeight;
const currentHeight = currentPosition.top;
const paddingBottom = totalPageHeight - currentHeight;
return paddingBottom;
} else {
return DEFAULT_PADDING;
}
},
};
FYI, @Wyzix33
Any update on this?
Thanks
Most helpful comment
I opened issue july and today Im still looking for library (js based) supports this feature because our curent process word template to pdf using apachepoi is complex. i wonder if psdmake is aim to have this feature and if this ask big effort to achieve
cc @liborm85