Reputation: 129
the image attached is the pdf document which i am automatically generating with a click by including the particular php file using MPDf library, Can any one please help me in how to increase the size of the text and make it clearly visible, and here is my code in order to convert to pdf thanks in advance.
<?php
require("mpdf60/mpdf.php");
$mpdf=new mPDF('utf-8','A3-L');//A4 page in portrait for landscape add -L.
$mpdf->debug = true;
$mpdf->allow_output_buffering = true;
//$mpdf->SetHeader('|Your Header here|');
//$mpdf->setFooter('{PAGENO}');// Giving page number to your footer.
//$mpdf->useOnlyCoreFonts = true; // false is default
$mpdf->SetDisplayMode('fullpage');
// Buffer the following html with PHP so we can store it to a variable later
ob_start();
?>
<?php
include_once "viewcomp.php";
//This is your php page ?>
<?php
$html = ob_get_contents();
ob_end_clean();
// send the captured HTML from the output buffer to the mPDF class for processing
$mpdf->WriteHTML($html);
//$mpdf->SetProtection(array(), 'user', 'password'); uncomment to protect your pdf page with password.
$mpdf->Output();
exit;
?>
Upvotes: 1
Views: 6513
Reputation: 3665
mPDF uses autosizing tables and this influences, among other things, the font-size as well. When outputting tables with mPDF you need to set:
<table style="overflow: wrap">
on every table according to this answer.
You can set font-size by $mpdf->SetFontSize(6);
Here font-size is measured in point(pt). Or you can set default font-size using the mpdf function SetDefaultFontSize()
. According to MPDF documentation, SetDefaultFontSize()
is depracated but still available. The other alternative is to edit the mpdf default stylesheet(mpdf.css).
Hope this may help
Upvotes: 1