2

对于我在 javascript 中使用 pdfmake 即时提供报价和发票 pdf 的项目。我想将包含签名字段的最后一个文本块附加到最后一页的底部。

我的 pdf docDefinition 是这样构建的:

return {
                content: [
                    getOfferLogo(), //Get the logo or empty string
                    getHeading(), //get the customer and business data (adress etc)
                    //the above is always the same
                    getText(), //get the textblock, created by user and always different
                    getSpecifics(), //get a table of payment specifications
                    getSignature() //get last textblock contaning signature fields etc, always the same
                ],
                styles: {
                    subheader: {
                        fontSize: 15,
                        bold: true,
                        alignment: 'center'
                    }
                },
                defaultStyle: {
                    columnGap: 20,
                    fontSize: 12
                }
            };

如何将通过调用 getSignature() 获得的最后一个文本块附加到 pdf 最后一页的底部?

4

1 回答 1

5
var docDefinition = {
    content: content,
    footer: function(currentPage, pageCount) {                 
        if (currentPage == pageCount)
            return "Your footer goes here";
    },
}
于 2017-05-23T10:07:34.437 回答