From 31ab7d387c356c9577d9d642738a3b9d0b2fa3ec Mon Sep 17 00:00:00 2001 From: Sean Engelhardt Date: Wed, 24 Jul 2019 16:56:22 +0200 Subject: [PATCH] Fix PDF TOC header Fixes an error where the PDF TOC header could not be repeated. PDFmake seems to ignore soft references to objects. It will print them exactly once and then ignore them. Also Adds the name of a parent category in a TOC-Table --- .../site/motions/services/motion-pdf-catalog.service.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/src/app/site/motions/services/motion-pdf-catalog.service.ts b/client/src/app/site/motions/services/motion-pdf-catalog.service.ts index 32c4a9c84..a6fbfc232 100644 --- a/client/src/app/site/motions/services/motion-pdf-catalog.service.ts +++ b/client/src/app/site/motions/services/motion-pdf-catalog.service.ts @@ -132,7 +132,7 @@ export class MotionPdfCatalogService { body: [ [ { - text: category.getTitle(), + text: category.nameWithParentAbove, style: !!category.parent ? 'tocSubcategoryTitle' : 'tocCategoryTitle' } ] @@ -158,7 +158,12 @@ export class MotionPdfCatalogService { } catTocBody.push( - this.pdfService.createTocTableDef(tocBody, StyleType.CATEGORY_SECTION, layout, header) + this.pdfService.createTocTableDef( + tocBody, + StyleType.CATEGORY_SECTION, + layout, + header ? JSON.parse(JSON.stringify(header)) : null + ) ); catTocBody.push(this.pdfService.getPageBreak());