プロジェクトの場合、javascript で pdfmake を使用してオンザフライでオファーと請求書の PDF を作成します。私が直面している問題は、テキストブロックが途中でページからはみ出すことです。私が望むのは、特定のテキスト ブロックまたは表がページ間で分割されるかどうかを確認し、その場合はブロックの前に改ページを追加して、テキストまたは表が完全に 1 ページに収まるようにすることです。
私の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
}
};
要するに、PDFを作成する前にテキストがページからはみ出すかどうかを確認し、それに応じて改ページを追加するにはどうすればよいですか?
前もって感謝します。