4
對於使用pdfmake進行報價和發票pdf的項目,使用pdfmake在javascript中。我面臨的問題是文本塊在頁面中間出現。我想要的是檢查文本或表格的某個塊是否要在頁面之間拆分,如果是這樣,請在塊之前添加分頁符以確保文本或表格完全位於一個頁面上。動態檢查文本使用pdfmake轉到下一頁並使用pdfmake添加分頁符使用pdfmake
我的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之前要關閉該頁面,並添加相應的pagebreaks?
在此先感謝。
使用上面的代碼獲取分頁符但不向n添加內容分機頁面。你能幫我嗎? –