Merge pull request #5536 from tsiegleauq/pdf-line-number-in-long-lists

PDF line number alignment
This commit is contained in:
Emanuel Schütze 2020-09-01 15:47:37 +02:00 committed by GitHub
commit 06974b559e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -176,6 +176,9 @@ export class HtmlToPdfService {
docDef.push(parsedElement);
}
// DEBUG: printing the following. Do not remove, just comment out
// console.log('MakePDF doc :\n---\n', JSON.stringify(docDef), '\n---\n');
return docDef;
}
@ -458,7 +461,6 @@ export class HtmlToPdfService {
// Add a blank with the normal font size here, so in rare cases the text
// is rendered on the next page and the line number on the previous page.
text: ' ',
fontSize: 10,
decoration: ''
},
{
@ -540,10 +542,8 @@ export class HtmlToPdfService {
}
}
// If this is an list item, add some space to the lineNumbers:
if (childrenLineNumbers.length && element.nodeName === 'LI') {
childrenLineNumbers[childrenLineNumbers.length - 1].marginBottom = this.LI_MARGIN_BOTTOM;
} else if (childrenLineNumbers.length && element.parentNode.nodeName === 'LI') {
// if the found element is a list item, add some spacing
if (childrenLineNumbers.length && (element.nodeName === 'LI' || element.parentNode.nodeName === 'LI')) {
childrenLineNumbers[childrenLineNumbers.length - 1].marginBottom = this.P_MARGIN_BOTTOM;
}