PDF Export Text and Print Button

PDF Export Text and Print Button

andrii.radkovskiiandrii.radkovskii Posts: 20Questions: 0Answers: 0

Hello, please help. How to add text to PDF Export?
live.datatables.net/gidariwo/10/edit

And Button Print doesn't work. Why?
live.datatables.net/voxorise/1/edit

Thanks!

Replies

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @andrii.radkovskii ,

    This example here should help. It shows how you can customise the PDFmake options.

    Other examples are on the forum (and StackOverflow) so it would be worth searching around for more if this doesn't help.

    Cheers,

    Colin

  • mgrajales815mgrajales815 Posts: 1Questions: 0Answers: 0

    hola

    esto es lo que he logrado hasta el momento, espero les funcione:
    buttons: [
    'copyHtml5',
    'excelHtml5',
    'csvHtml5',
    {extend: 'pdfHtml5',
    title:' ',
    exportOptions: {

                                 columns: [ 1]//solo muestra la columna #...
                            },
                customize: function ( doc) {
                        var cols = [];
                        cols[0] = {text: 'Left part', alignment: 'left', margin:[20] };
                        cols[1] = {text: 'Right part', alignment: 'right', margin:[0,0,20] };
                        var objFooter = {};
                        objFooter['alignment'] = 'center';
                        objFooter['columns'] = cols;
                        doc["footer"]=objFooter;
                        doc.content.splice( 1, 0,{
                            table: {
          body: [
                                        [{rowSpan: 3, margin: [ 0, 0, 0, 2 ],
                                             alignment: 'center',
                                             image: 'data:image/jpeg;base64,/....',
                                             width: 50,
                                             height: 50},
                                                    {rowSpan: 3,text: "su texto",
                                                 fontSize: 9,
                                                 alignment: 'center'},{text: 'CÓDIGO',fontSize:7,  alignment: 'center'}, {text: 'MINREI-FR-#',fontSize:7,  colSpan: 3, alignment: 'center'}, {},{}],
                                        ['','', {text: 'VERSIÓN',fontSize:7, alignment: 'center'}, {text: '1',fontSize:7,  colSpan: 3, alignment: 'center'}, {},{}],
                                        ['','', {text: 'PÁGINA',fontSize:7, alignment: 'center'}, '1', {text: 'DE',fontSize:7, alignment: 'center'},'1']
                                    ]
                            }
                         },
                        );
                        }
                        }
                    ],
    
This discussion has been closed.