Merge pull request #4937 from tsiegleauq/pdf-empty-page
Fix empty PDF TOC page
This commit is contained in:
commit
216f34c51b
@ -127,6 +127,11 @@ export class MotionPdfCatalogService {
|
|||||||
const motionToCurrentCat = motions.filter(motionIn => category === motionIn.category);
|
const motionToCurrentCat = motions.filter(motionIn => category === motionIn.category);
|
||||||
|
|
||||||
if (motionToCurrentCat && motionToCurrentCat.length) {
|
if (motionToCurrentCat && motionToCurrentCat.length) {
|
||||||
|
// if this is not the first page, start with a pagebreak
|
||||||
|
if (catTocBody.length) {
|
||||||
|
catTocBody.push(this.pdfService.getPageBreak());
|
||||||
|
}
|
||||||
|
|
||||||
catTocBody.push({
|
catTocBody.push({
|
||||||
table: {
|
table: {
|
||||||
body: [
|
body: [
|
||||||
@ -165,8 +170,6 @@ export class MotionPdfCatalogService {
|
|||||||
header ? JSON.parse(JSON.stringify(header)) : null
|
header ? JSON.parse(JSON.stringify(header)) : null
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
catTocBody.push(this.pdfService.getPageBreak());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,6 +186,7 @@ export class MotionPdfCatalogService {
|
|||||||
|
|
||||||
// only push this array if there is at least one entry
|
// only push this array if there is at least one entry
|
||||||
if (uncatTocBody.length > 0) {
|
if (uncatTocBody.length > 0) {
|
||||||
|
catTocBody.push(this.pdfService.getPageBreak());
|
||||||
catTocBody.push(this.pdfService.createTocTableDef(uncatTocBody, StyleType.CATEGORY_SECTION));
|
catTocBody.push(this.pdfService.createTocTableDef(uncatTocBody, StyleType.CATEGORY_SECTION));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user