the pdf button is not displayed

the pdf button is not displayed

obskobsk Posts: 12Questions: 1Answers: 0

Hi Guys, I have an application that only shows the copy and print buttons, I have all the scripts initialized. How to make it also show the pdf button?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,117Questions: 26Answers: 4,916

    Are you loading the pdfmake and vfs_fonts.js JS?

    Not sure its well documented but on the download page you can see they are required required:
    https://datatables.net/download/index

    One of the PDF button examples will show you the link to the files:
    https://datatables.net/extensions/buttons/examples/html5/pdfMessage.html

    Kevin

  • obskobsk Posts: 12Questions: 1Answers: 0

    yes, thank for your response,apparently loaded. Send snapshot. I'm stuck

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    Answer ✓

    Try loading pdfmake.min.js before datatables.buttons.min.js.

  • obskobsk Posts: 12Questions: 1Answers: 0

    thanks, awesome! , one last question, I have a hidden column and when I make the export that does not occupy the entire sheet. What is the cause of that?. Regards

  • allanallan Posts: 63,075Questions: 1Answers: 10,384 Site admin

    It does not occupy the entire sheet? Do you want it to?

    Can you link to a test page showing the issue please.

    Allan

  • obskobsk Posts: 12Questions: 1Answers: 0
    edited September 2017

    previously occupied the entire width of the sheet,now hide a column from the datatable and do not adjust the width.

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    now hide a column from the datatable

    Which column? If it's the first column, your exportOptions columns array should begin at 0.

  • obskobsk Posts: 12Questions: 1Answers: 0

    Thanks for your response, I hide column 0, because they are keys. now the width does not fit the following columns as shown in the image.

  • kthorngrenkthorngren Posts: 21,117Questions: 26Answers: 4,916
    edited September 2017

    Not sure if the code in this thread works but you might want to give it a try. It uses the customize function to set the column widths.

    Kevin

This discussion has been closed.