PDF line number alignment
- Aligns line number for long lists - Better support for changes to the default font
This commit is contained in:
parent
9a4f8e1781
commit
ef87f05454
@ -176,6 +176,9 @@ export class HtmlToPdfService {
|
|||||||
docDef.push(parsedElement);
|
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;
|
return docDef;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -458,7 +461,6 @@ export class HtmlToPdfService {
|
|||||||
// Add a blank with the normal font size here, so in rare cases the text
|
// 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.
|
// is rendered on the next page and the line number on the previous page.
|
||||||
text: ' ',
|
text: ' ',
|
||||||
fontSize: 10,
|
|
||||||
decoration: ''
|
decoration: ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -540,10 +542,8 @@ export class HtmlToPdfService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this is an list item, add some space to the lineNumbers:
|
// if the found element is a list item, add some spacing
|
||||||
if (childrenLineNumbers.length && element.nodeName === 'LI') {
|
if (childrenLineNumbers.length && (element.nodeName === 'LI' || element.parentNode.nodeName === 'LI')) {
|
||||||
childrenLineNumbers[childrenLineNumbers.length - 1].marginBottom = this.LI_MARGIN_BOTTOM;
|
|
||||||
} else if (childrenLineNumbers.length && element.parentNode.nodeName === 'LI') {
|
|
||||||
childrenLineNumbers[childrenLineNumbers.length - 1].marginBottom = this.P_MARGIN_BOTTOM;
|
childrenLineNumbers[childrenLineNumbers.length - 1].marginBottom = this.P_MARGIN_BOTTOM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user