php - Internal style not working for my pdf -
$pdf = new pdf([ // set use core fonts 'mode' => pdf::mode_core, // a4 paper format 'format' => pdf::format_a4, // portrait orientation 'orientation' => pdf::orient_portrait, // stream browser inline 'destination' => pdf::dest_browser, // html content input 'content' => $content, // format content own css file if needed or use // enhanced bootstrap css built krajee mpdf formatting 'cssfile' => '@vendor/kartik-v/yii2-mpdf/assets/kv-mpdf-bootstrap.min.css', // css embedded if required 'cssinline' => '.kv-heading-1{font-size:18mm}', // set mpdf properties on fly 'options' => ['title' => 'title'], // call mpdf methods on fly 'methods' => [ // 'setheader'=>['krajee report header'], // 'setfooter'=>['{pageno}'], ], 'margintop' => 1, 'marginbottom' => 1, 'marginleft' => 2, 'marginright' => 0, ]);
html:
$html = '<style>'. $mystyle .' </style>'; $html .= '<div>' . $mydiv . '</div>'; echo $html;
trying print div internal style internal style don't seem work though div showing. there not error shown there chance doesn't support internal style? or did miss out something?
**inline style working
the answer found internal style not working because whatever pass pdf read 'content'. need pass style 'cssinline' , not 'content'.
Comments
Post a Comment