PDF - download: 'open' HOW CAN I CHANGE THE FILENAME AFTER OPEN IT IN NEW PAGE?

PDF - download: 'open' HOW CAN I CHANGE THE FILENAME AFTER OPEN IT IN NEW PAGE?

djaydotedjaydote Posts: 1Questions: 1Answers: 0
edited April 2018 in Free community support

this is my code: but this is not working! how to change the file name, with download: 'open' ??

buttons: [
    {
        text: 'PDF',
        title: 'Equipment',
        extend: 'pdfHtml5',
        filename: "Equipment",
        download: 'open',
        pageSize: 'LETTER',
    orientation: 'portrait',
    alignment: 'center',
    exportOptions: {
                    columns: [ 1, 2,3 ]
                },

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586
    edited April 2018

    Hi @djaydote ,

    I just tried it and I don't think that's possible, though I can see why it would be a useful extension. I'll see if it's possible to add it into a future release.

    Cheers,

    Colin

  • allanallan Posts: 61,669Questions: 1Answers: 10,096 Site admin

    To be perfectly honest, I'm not actually sure where that uuid is coming from. uuid isn't used in the pdfmake code and its certainly not something coming from DataTables or Buttons.

    The pdfmake examples do exactly the same thing.

    I suspect that it is actually a browser thing since it needs to show something in the address bar. I don't think there is much we can do about that, but it might be worth opening a pdfmake question and see if they can help you.

    Allan

  • rkralstonrkralston Posts: 3Questions: 0Answers: 0

    you can set the title in pdfmake in the metadata:

    https://pdfmake.github.io/docs/document-definition-object/document-medatadata/

This discussion has been closed.