我正在尝试将自定义 css 样式应用于导出的文件,例如 pdf。
例如如何在 pdf 导出中应用自定义 css 样式?
我更改了一些字体样式,styleOptions
但没有任何反应。
<?= ExportMenu::widget([
'target' => ExportMenu::TARGET_SELF,
'dataProvider' => $dataProvider,
'columns' => $report_columns,
'fontAwesome' => true,
'dropdownOptions' => [
'label' => Yii::t('app','Export All'),
'class' => 'btn btn-default'
],
'styleOptions' => [
'font' => [
'size' => '24px',
'bold' => true,
'color' => [
'argb' => 'FFFFFFFF',
],
],
'fill' => [
'type' => PHPExcel_Style_Fill::FILL_SOLID,
'color' => [
'argb' => '00000000',
],
],
],
'exportConfig' => [
ExportMenu::FORMAT_CSV => false,
ExportMenu::FORMAT_EXCEL => false,
ExportMenu::FORMAT_EXCEL_X => false,
ExportMenu::FORMAT_TEXT => false,
//ExportMenu::FORMAT_PDF => false,
//ExportMenu::FORMAT_HTML => false
]
]) . "<hr>\n".
GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => $columns,
'pjax' => true,
'summary' => '',
'options' => ['class' => 'xxx', 'style'=>'padding-right:10px']
]);
?>