Link in 'message' of pdfHtml5 button
Link in 'message' of pdfHtml5 button
I would like to place a link in the text of 'message' within a pdfHtml5 button.
{
extend: 'pdfHtml5',
text: 'PDF',
titleAttr: 'PDF',
title: 'My title',
header: true,
message: 'And I would like to have a link <a href="www.google.com">here</a>. Many thanks. ',
customize: function(doc) {
doc.defaultStyle.fontSize = 6;
doc.styles.title.margin = [0, 20, 0, 12];
}
}
I suppose I need a function for 'message'?! ... but how do I do this? https://datatables.net/reference/button/pdfHtml5
And trying to set the titles margin with doc.styles.title.margin = [0, 20, 0, 12]; does not trigger? Why so?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You can't just use HTML in the PDF I'm afraid. You'd need to have a read at the pdfmake documentation to see how links are constructed with their API.
You can then use the
customize
callback to modify the document to your needs.Allan
No problem. What works e.g. is if I splice the 'message' with e.g.
I get the blue and the underline ... but not the link. It's inactive. Any ideas why? Normally this is working. Thanks
Not a clue I'm afraid. That would be one for the pdfmake support channels.
Allan
No problem. I'll check with them. Regards