-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set two different links in one line. #44
Comments
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 {
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 ㅠㅡㅠ
The text was updated successfully, but these errors were encountered: