pdfHtml5
pdfHtml5
nublet
Posts: 2Questions: 1Answers: 0
Hi,
i am using pdfHtml5 to export my table, exporting to pdf is working as it should. my problem is, i have 3 colums on the 3rd column i have my data displayed in unordered list, exporting it to pdf makes the unordered list disappear making the data displays in a single wrapped fashion.
here is my script:
var dt = tableContainer.DataTable({
"dom": 'Bfrtip',
"lengthMenu": [
[ 100, 200, 300, 400, 500, -1 ],
[ '100 rows', '200 rows', '300 rows', '400 rows', '500 rows', 'Show all' ]
],
"buttons": [
'pageLength',
{
extend: 'pdfHmtl5',
title: 'this is designed to work'
}
],
"bStateSave": false,
"processing": true,
"serverSide": true,
"pageLength": 100,
"order": [[ 0, "desc" ]],
"bInfo" : true,
"bFilter" : false,
"language": {
"infoFiltered": ""
},
"columns": [
{ "type": "integer", "orderable": true, "className": "vtop" },
{ "type": "string", "orderable": false, "className": "vtop" },
{ "type": "string", "orderable": false }
],
"bSort": true,
"ajax": base + "/folder/folder/ajax_folder_list.php"+vars
});
i have also read the document for pdfHtml5 and makePDF, i just dont know where to start.
regards,
This discussion has been closed.
Answers
By default Buttons will strip HTML from the exported data (see this thread). You probably need to include the HTML, but also process it so that pdfmake will show line breaks for the list items. I'm not entirely sure how that is done with their API.
Allan
i checked and tested the link you provided, setting the stripNewlines in my script.
with no effect in the exported pdf file. reading further the pdfmake docs. it say..
i tried fiddling with format export options and customize with no success
example export options:
example customize function:
still thinking where and how i can manipulate the script just like in the makepdf docs.
best regards,
I think its going to come down to modifying the document structure that Buttons generates - specifically for the column in question. If you have a look at the pdfmake playground and then load the "tables" example the second table shows how it is possible to get a list into the table:
That's probably not going to be trivial to implement I'm afraid, but it looks like it should be possible.
Allan