Link to home
Start Free TrialLog in
Avatar of eman ali
eman ali

asked on

Angular UI Grid pdf export - Exporting an image, along a header

User generated image
I am tried to export pdf UI grid data along with multiple line title and image logo. its setting only first three line as title line even there was more than 3 line in code.
exported pdf file has been attached and wan  to set logo yellow mark position on pdf.
Could you please help me? Thanks in advance


vm.gridOptions = {
                enableFiltering : true,
                enableGridMenu : true,
                onRegisterApi : function(gridApi) {
                    $scope.gridApi = gridApi;
                },

                exporterCsvFilename : 'myfile.csv',

                  exporterPdfHeader: {
                        text: [
                            'line 1',
                            {text: 'hello altruist\nplease \nhelp me'},
                            'end of line 1\n',
                            'Second line \n',
                            'Third line\n',
                            'fghfhgf line\n',
                            'Third line'
                        ], style: 'headerStyle'
                    },

                    exporterPdfFooter: function ( currentPage, pageCount ) {
                          return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' };
                        },
                        exporterPdfCustomFormatter: function ( docDefinition ) {
                            docDefinition.styles.headerStyle = { fontSize: 10, bold: true,alignment: 'center'};
                            docDefinition.styles.footerStyle = { fontSize: 10, bold: true,alignment: 'right' };
                            return docDefinition;
                          },

                exporterHeaderFilterUseName: true,      
                 exporterPdfDefaultStyle: {fontSize: 9},
                                        //left, top, right,bottom  
                exporterPdfTableStyle: {margin: [0, 0, 0, 0]},
                exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red', alignment: 'center'},
                exporterPdfOrientation: 'landscape',
               // exporterPdfPageSize: 'LETTER',
                exporterPdfPageSize:'A4',
                //exporterPdfMaxGridWidth: 475,
              exporterPdfMaxGridWidth: 700,  

                columnDefs:vm.colDef,

            };
    }
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.