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
This commit is contained in:
Sean Engelhardt 2019-07-24 16:56:22 +02:00
parent 93e37720dc
commit 31ab7d387c

View File

@ -132,7 +132,7 @@ export class MotionPdfCatalogService {
body: [ body: [
[ [
{ {
text: category.getTitle(), text: category.nameWithParentAbove,
style: !!category.parent ? 'tocSubcategoryTitle' : 'tocCategoryTitle' style: !!category.parent ? 'tocSubcategoryTitle' : 'tocCategoryTitle'
} }
] ]
@ -158,7 +158,12 @@ export class MotionPdfCatalogService {
} }
catTocBody.push( 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()); catTocBody.push(this.pdfService.getPageBreak());