Cannot get the PDF button to show on any browser

Cannot get the PDF button to show on any browser

shaneamondosshaneamondos Posts: 10Questions: 5Answers: 0
edited November 2016 in Free community support

I have looked at the button config tutorials throughout this website including this one

https://datatables.net/extensions/buttons/examples/initialisation/simple.html

However i have not been able to get it the button to work. All other buttons work completely fine.

[
        {
            extend:    'copyHtml5',
            text:      '<i class="fa fa-files-o"></i>',
            titleAttr: 'Copy',
            className: 'export-copy',
            exportOptions: {
                columns: ':visible'
            }
        },
        {
            extend:    'excelHtml5',
            text:      '<i class="fa fa-file-excel-o"></i>',
            className: 'export-xls',
            titleAttr: 'Excel',
            exportOptions: {
                columns: ':visible'
            }
        },
        {
            extend:    'csvHtml5',
            text:      '<i class="fa fa-file-text-o"></i>',
            titleAttr: 'CSV',
            className: 'export-csv',
            exportOptions: {
                columns: ':visible'
            }
        },
        {
            extend:    'print',
            text:      '<i class="fa fa-file-pdf-o"></i>',
            titleAttr: 'PDF',
            className: 'export-print',
            orientation: 'landscape',
            exportOptions: {
                columns: ':visible'
            }
        },
//I have tried both pdf and pdfHtml5 extensions but both do not work
        {
            extend:    'pdf',
            text:      '<i class="fa fa-file-pdf-o"></i>',
            titleAttr: 'PDF',
            className: 'export-pdf',
            exportOptions: {
                columns: ':visible'
            }
        }

Here are my cdn's:

<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/jszip-2.5.0/dt-1.10.12/b-1.2.1/b-html5-1.2.1/b-print-1.2.1/fc-3.2.2/fh-3.1.2/sc-1.4.2/se-1.2.0/datatables.min.css"/>
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/jszip-2.5.0/dt-1.10.12/b-1.2.1/b-html5-1.2.1/b-print-1.2.1/fc-3.2.2/fh-3.1.2/sc-1.4.2/se-1.2.0/datatables.min.js"></script>

This question has an accepted answers - jump to answer

Answers

  • WebCodexWebCodex Posts: 71Questions: 13Answers: 3
    Answer ✓

    Where are your PDF cdns?

  • shaneamondosshaneamondos Posts: 10Questions: 5Answers: 0
    edited November 2016

    This has been resolved. I read through other recent questions and found that i had not used the download builder correctly as my cdn's were not correct.

    I needed to include pdfmake-0.1.18 in the source.

    WebCodex had also pointed this out which i realised when i posted this

This discussion has been closed.