答案 0 :(得分:0)
第二个参数是一个具有" pdfmake"的所有选项的对象。
要掌握的最基本的概念是 document-definition-object,可以这么简单:
var docDefinition = { content: 'This is an sample PDF printed withpdfMake' };
或变得相当复杂(具有多级表格, 图像,列表,段落,边距,样式等......)。
您可以查看Github https://github.com/bpampuch/pdfmake上的文档,并将其复杂化。
但是如果您使用 pdfExport 功能,那么这个用数据网格创建对象,更容易,试试这个:
$scope.gridApi.exporter.pdfExport( uiGridExporterConstants.ALL, uiGridExporterConstants.ALL );
他们有更多选项可以在gridOptions中更改:
exporterPdfDefaultStyle:{ fontSize: 11 },
exporterPdfFilename: 'filename.pdf',
exporterPdfTableHeaderStyle: { bold: true, fontSize: 12, color: 'black' },
exporterPdfTableStyle : { margin: [0, 5, 0, 15] },
exporterPdfHeader : null,
exporterPdfFooter : null,
gridOptions.exporterPdfOrientation : 'landscape',
等...