mpdf

Footer in last printed page MPDF

时光总嘲笑我的痴心妄想 提交于 2020-01-13 05:17:46
问题 Hi i am using MPDF but i cant print footer on the last page, i am printing 2-7 pages this is my code for footer $mpdf->SetHTMLFooter(' <div id="firmas"> <table width="100%"><tr> <td><br><br><br><br><br><small><h3><font face=\'Arial\'>Recibí Conforme</font> </h3><small> </td><td><br><br><br><br><small><h3><font face=\'Arial \'>Vo.Bo</font> </h3><small></td><td><small><br><br><br><br><br><h3><font face=\'Arial\'>Entregue Conforme</font></h3><small></td> </tr> </table> </div> '); I would like to

Using mpdf with codeigniter generate blank output

谁说胖子不能爱 提交于 2020-01-06 19:17:27
问题 I have been flowing this post to generate a pdf but the output is blank and there is no error displayed , i have put : public function generate_pdf() { $this->load->library('mpdf'); $mpdf=new mPDF('utf-8','A4'); $mpdf->WriteHTML('<p>HTML content goes here...</p>'); $mpdf->Output(); } When i put : public function generate_pdf() { $this->load->library('mpdf'); $mpdf=new mPDF('utf-8','A4'); $mpdf->debug = true; $mpdf->WriteHTML('<p>HTML content goes here...</p>'); $mpdf->Output(); } referred to

Bootstrap not working inside pdf

六月ゝ 毕业季﹏ 提交于 2020-01-06 08:29:13
问题 This is my controller code public function actionPrint_death_certificate1() { $this->layout = 'certificate'; $html = $this->render('test'); require_once(Yii::$app->basePath . "/../vendor/mpdf/mpdf/mpdf.php"); $mpdf=new mPDF(); $mpdf->WriteHTML($html); $mpdf->Output(); } My view <div class="container"> <div class="row"> <div class="col-md-6"> Heading1 </div> <div class="col-md-6"> Heading2 </div> </div> </div> Now i get a pdf with heading1 and heading2 in two different lines. Bootstrap is not

MPDF not supporting image/icon rotation

风流意气都作罢 提交于 2020-01-06 04:52:24
问题 I would like to generate a PDF from my HTML script.Now the script is <?php require_once __DIR__ . '/vendor/autoload.php'; $mpdf = new \Mpdf\Mpdf(); $mpdf->WriteHTML('<div class="pageContatiner noSelect ui-droppable slctCon"><div onmousedown="objSelection(this)" ontouchstart="objSelection(this)" id="pmObj-1" class="shape obj" style="width: 136.217px; height: 136.217px; position: absolute; transform: matrix(-0.491017, -0.87115, 0.87115, -0.491017, 0, 0); margin-left: 312px; margin-top: 99px;" x

Generate an MPDF to PDF with HTML and PHP

孤街浪徒 提交于 2020-01-05 13:51:58
问题 This the my code a CV that I want to create an MPDF with and underneath I have the MPDF code that is on another page. The content is appearing on the pdf but with php echo values when i want the actual php values instead <?php //Image upload $uploaddir = "images\\"; $uploadfile = $uploaddir . $userTime . basename($_FILES['myimg']['name']); move_uploaded_file($_FILES["myimg"]["tmp_name"], "$uploadfile"); $_SESSION['myimg'] = $uploadfile; if(isset($_FILES['myimg'])){ $file = $_FILES['myimg'][

Generate an MPDF to PDF with HTML and PHP

谁说我不能喝 提交于 2020-01-05 13:51:24
问题 This the my code a CV that I want to create an MPDF with and underneath I have the MPDF code that is on another page. The content is appearing on the pdf but with php echo values when i want the actual php values instead <?php //Image upload $uploaddir = "images\\"; $uploadfile = $uploaddir . $userTime . basename($_FILES['myimg']['name']); move_uploaded_file($_FILES["myimg"]["tmp_name"], "$uploadfile"); $_SESSION['myimg'] = $uploadfile; if(isset($_FILES['myimg'])){ $file = $_FILES['myimg'][

MPDF - different background for first page

こ雲淡風輕ζ 提交于 2020-01-05 09:29:14
问题 I am using MPDF to generate PDF-files out of HTML code. Unfortunately, the layout for the first page is different from the rest of the pages. Is there any way to give the first page a different background from the rest? And how about layout, is there any way to set the header and footer on a different place or remove the whole header from the second till last page? 回答1: <style> @page :first { background: url("http://example.com/first.svg") 50% 0 repeat; } @page { background: url("http:/

how to use PHP to write the PDF?

删除回忆录丶 提交于 2020-01-04 06:01:08
问题 It doesn't display ite1 value in the pdf. Why? Could you please, correct my mistake? <?php set_include_path($_SERVER['DOCUMENT_ROOT'] .'/mpdf/'); require('mpdf.php'); $n = 0; $mpdf=new mPDF(); require_once('../../includes/common.php'); $result = mysql_query("SELECT * from sgc where year = '2010'") or die(mysql_error()); $row=mysql_fetch_array($result); $nric=$row['nric']; $row=mysql_fetch_array($result); $meta_ite=$row['meta_ite']; $mpdf->WriteHTML('<p>Hello World</p>'); $html1 = '<table> <tr

How to put line break in mpdf when data is extracted from mysql database

孤者浪人 提交于 2019-12-31 04:56:06
问题 I am using MPDF to generate pdf files from data stored in mysql database. Though I could extract and display others data as expected, I could not display multiline text as they all comes in single line. Could someone help me to resolve this problem. EG. My data from textarea is shown in database as: One Two Three But in pdf it will ge generated as OneTwoThree When I check in database using phpmyadmin its stored data as One\r\nTwo\r\nThree Please help. 回答1: Try with this code. $finalString =

mPDF not rendering images (mPDF error: IMAGE Error Could not find image file)

雨燕双飞 提交于 2019-12-29 06:53:28
问题 We are getting plagued with this which started in April on working server. Everything was fine with our application until the customer reported that PDFs were no longer displaying the images. Our PDF is generated via a HTML render first. When the HTML render is displayed the Image shows correctly. Also the image shows correctly if the image URL as noted in the mPDF is copied and pasted into a new tab. However... If we load the image from a DIFFERENT DOMAIN then the image is rendered correctly