Open bso-oo opened 3 years ago
Hello, here you really have to check with PDFKit documentation, on how to write in a same line texts that have different formatting.
You can read the doc here on how to have normal text, followed by text with a link, and text with an other link.
Hello, here you really have to check with PDFKit documentation, on how to write in a same line texts that have different formatting.
You can read the doc here on how to have normal text, followed by text with a link, and text with an other link.
is it possible to table????
You can do this by using standard methods from PDFkit, and cache: false
in the column definition:
{
id: 'description',
header: 'Product',
align: 'left',
cache: false,
renderer(tb, data, draw, column, pos) {
if (!draw) {
// Calculating cell size content. We build
// the complete string (without links)
return `${data.description} ( dm pc )`;
}
// Drawing cell content. We use standard PDFkit
// methods
tb.pdf
.text(data.description, pos.x, pos.y, { continued: true })
.text(' ( ', { continued: true })
.fillColor('blue')
.text('dm', {
continued: true,
underline: true,
link: data.link1
})
.text(' ', { continued: true, underline: false })
.text('pc', {
continued: true,
underline: true,
link: data.link2
})
.fillColor('black')
.text(' )', { underline: false });
}
},
With some data looking like this:
[
{
description: 'Product 2',
link1: 'https://www.wikipedia.org',
link2: 'https://www.gnu.org',
quantity: 4
}
]
`let betaDivTable = new PdfTable(doc, { // bottomMargin: 30 });
I want to this
two different links in one line.
please ㅠㅡㅠ