Columns truncating while generating pdf
Columns truncating while generating pdf
The columns in my datatable are 7, but when I create pdf using pdfHtml5, only first 5 columns are displayed and 5th column is also displayed not fully.
My options look like below
{
data: parsed.ListOfDataRecords,
columns: parsed.ListOfSelectedColumns,
"order": sortOrders,
dom: 'Blfrtip',
buttons: [
'pdf'
],
scrollX: true,
scrollY: '56vh',
scrollCollapse: true,
paging: false
}
Following js libraries are used by me in this order (un minified and downloaded locally)
<link href="Content/Site.css" rel="stylesheet" />
<link href="Content/bootstrap.min.css" rel="stylesheet" />
<link href="Content/DataTables/datatables.min.css" rel="stylesheet" />
<script src="Content/Scripts/jquery-3.3.1.min.js"></script>
<script src="Content/DataTables/datatables.js"></script>
<script src="Content/DataTables/Buttons/dataTables.buttons.js"></script>
<script src="Content/DataTables/Buttons/buttons.flash.js"></script>
<script src="Content/DataTables/Buttons/jszip.js"></script>
<script src="Content/DataTables/Buttons/pdfmake.js"></script>
<script src="Content/DataTables/Buttons/vfs_fonts.js"></script>
<script src="Content/DataTables/Buttons/buttons.html5.js"></script>
<script src="Content/DataTables/Buttons/buttons.print.js"></script>
Answers
Hi @nishantteria ,
Maybe try the
pdfHtml5
button, as in the example here. Otherwise, we're happy to take a look, but coud you link a test page that demonstrate the problem - it'll be easier to debug and understand,Cheers,
Colin