-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
Bug Report
Description of the problem
When I use custom font in CellOptions pdfkit ignore property because th source code has a bug in line
https://github.com/foliojs/pdfkit/blob/master/lib/table/render.js#L86,
I think resolution be as use text function:
const doc = new PDFDocument({
margin: 50,
size: 'A4',
layout: 'landscape',
});
doc.font(...)P.S. I use typescript with @types/pdfkit and customFont doesn`t allow in CellOptions
Code sample
const tableHeaders = [
{
text: 'Header 1',
// temporary fix
font: { src: PDF_FONT_BOLD },
fontSize: 12,
// temporary fix
customFont: true,
},
...days.map((day) => ({
text: day.getDate().toString(),
})),
] as TableCell[];Your environment
- pdfkit version: 0.17.1
- @types/pdfkit: 0.17.0
- Node version: v20.12.2
- Browser version (if applicable): Edge
- Operating System: Windows 11
Metadata
Metadata
Assignees
Labels
No labels