1

,如果我得到这样的列数据与而导出为PDF,列内容超过uigrid列边框angularjs

之间

$scope.gridOptions.data = [{"name":"rasheedsyedabdulhameed"}]; 没有空间,这是我gridoptions

$scope.gridOptions = { 
columnDefs: [ 
    { field: 'name' }, 
    { field: 'name' }, 
    { field: 'name' } 
], 
enableGridMenu: true, 
enableSelectAll: true, 
exporterCsvFilename: 'myFile.csv', 
exporterPdfDefaultStyle: {fontSize: 9}, 
exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, 
exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, 
exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, 
exporterPdfFooter: function (currentPage, pageCount) { 
    return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; 
}, 
exporterPdfCustomFormatter: function (docDefinition) { 
    docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; 
    docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; 
    return docDefinition; 
}, 
exporterPdfOrientation: 'landscape', 
exporterPdfPageSize: 'LETTER', 
exporterPdfMaxGridWidth: 500, 
exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), 
onRegisterApi: function(gridApi){ 
    $scope.gridApi = gridApi; 
} 

} ;

在导出为PDF表中的内容超过了列边框,这是我的例子plunker just a sample

+0

找到这个例子非常有用,特别是页脚/标题属性。 –

回答

0

您可以使用width: "*"每一列,使其调整的内容。但是,如果内容非常大,您的表格可能会超出页面大小。