mpdf

change top margin of second page using mPDF

廉价感情. 提交于 2020-12-08 07:34:10
问题 I'm dynamically generating PDFs with an unknown page count. mPDF is working good, but the top margin on the second page is gone. How can I set the margins for all pages with the document? I've tried the following, but it has no effect: $mpdf = new mPDF('', '', 0, '', 15, 15, 15, 15, 8, 8); 回答1: You can use something like this. it seems to work. define the margins using @page like: <?php include("mpdf.php"); $html='<style>@page { margin: 0px; }</style> '; $mpdf=new mPDF('','A4'); $mpdf-

mPDF temporary file is not writable using Yii

不羁岁月 提交于 2020-05-13 06:27:57
问题 I tried to print a certificate in PDF but when I push my code to staging, it said Temporary files directory "/var/www/protected/vendor/mpdf/mpdf/src/Config/../../tmp" is not writable I'm not sure how to change the permission and how to change the custom directory. Here's my code of a button to click to get the certificate: <a class="btn btn-sd btn-sd-ghost btn-sd-ghost-black margin-right-lg" href="<?php echo $this->createUrl('//idea/frontend/pdf', array('id'=>$model->id))?>" target="_blank"

mPDF temporary file is not writable using Yii

╄→гoц情女王★ 提交于 2020-05-13 06:25:28
问题 I tried to print a certificate in PDF but when I push my code to staging, it said Temporary files directory "/var/www/protected/vendor/mpdf/mpdf/src/Config/../../tmp" is not writable I'm not sure how to change the permission and how to change the custom directory. Here's my code of a button to click to get the certificate: <a class="btn btn-sd btn-sd-ghost btn-sd-ghost-black margin-right-lg" href="<?php echo $this->createUrl('//idea/frontend/pdf', array('id'=>$model->id))?>" target="_blank"

How do I install mpdf 7 without composer?

|▌冷眼眸甩不掉的悲伤 提交于 2020-04-09 20:05:48
问题 I'm currently using mpdf 6.1 and I'd like to switch to 7. But I can't find a way to install it without composer. Is there a full package that I can download, unzip and test on my localhost? 回答1: well, i've spend few days to search a way, finally i found it, you can download full package mpdf in this site, after download extract files and place on your project and load 'vendor/autoload.php'. in my case i use it with codeigniter , so i make some php file on libraries folder to load it. <?php if

How to use bootstrap in mPDF?

僤鯓⒐⒋嵵緔 提交于 2020-02-27 09:18:21
问题 I am currently using mpdf to generate my pdfs from html. So far with my current html that I am passing in, I am able to generate a one page pdf with a header and footer. However, if there is more than one page, my footer goes all the way to the bottom of the second page. Is there a way to add a header and footer for each page? I have tried $pdf->setHTMLHeader but it doesn't seem to take my css files in and it leaves an x where my logo is supposed to be. How can I do this? I have tried

mPDF setAutoMargin not working for first page

强颜欢笑 提交于 2020-01-25 04:26:26
问题 The following code works perfectly for the second, third etc pages, but not for the first one. /* * Encoding * Size (A4, etc) * Font-size * Font-type * margin_left * margin_right * margin_top * margin_bottom * margin_header * margin_footer * Orientation */ $this->mPDF = new mPDF('utf-8', 'A4', 9, 'freesans', 10, 10, 0, 25, 5, 4, 'P'); $this->mPDF->setAutoTopMargin = 'pad'; $html = '<sethtmlpageheader name="myheader" value="on" show-this-page="1"></sethtmlpageheader>'; In the first page, the

mpdf change temp path (composer package)

风流意气都作罢 提交于 2020-01-24 00:31:09
问题 I have installed mpdf/mpdf via composer. All works perfectly in development environment, however in production / staging, I get a permissions error. file_put_contents(\/.../ttfontdata\/dejavusanscondensed.GSUBGPOStables.dat): failed to open stream: Permission denied' in .../shared\/vendor\/mpdf\/mpdf\/classes\/ttfontsuni.php:999\nStack trace:\n#0 [internal function]: Illuminate\\Exception\\Handler->handleError(2, 'file_put_conten...', '...', 999, Array)\n#1 As per mpdf documentation, I need

How to use Hindi fonts in mpdf library?

大兔子大兔子 提交于 2020-01-22 03:15:08
问题 i am working with mpdf library with php to create dynamic PDF. PDF is creating with English characters but when i try to use hindi language's character, it prints ??????. Please suggest me that what should i do.I will be thank full to all. <?php require_once('config.php'); require_once __DIR__ . '/lib/functions.php'; require_once __DIR__ . '/lib/mpdf/vendor/autoload.php'; $mpdf = new \Mpdf\Mpdf(['utf-8', 'A4-C']); // New PDF object with encoding & page size $mpdf->text_input_as_HTML = TRUE;

mpdf not supporting arabic and chinese fonts

青春壹個敷衍的年華 提交于 2020-01-21 03:13:06
问题 I am using mpdf. When I supplied the arabic and chinese words to the WriteHtml(), the resulting pdf containing square boxes instead of those fonts. Please suggest! Sample fonts: I am testing أنا العالم 我的世界 回答1: On mPDF 6.0, we found this made Cantonese work for us: $mpdf->autoScriptToLang = true; $mpdf->autoLangToFont = true; Seems SetAutoFont is now deprecated. 回答2: Add this to your php code: $mpdf->autoScriptToLang = true; $mpdf->autoLangToFont = true; in css file make sure that you have:

Convert PDF to HTML in PHP similar to DocuSign

南楼画角 提交于 2020-01-16 09:01:49
问题 we are developing a website that needs to convert PDF files into HTML because some of the PDF has a form (not necessarily fillable PDF, these PDFs are printed to be filled up). So we want it to be filled up through our website instead of printing the files and filled up by pen. We are going paperless. DocuSign provides these wherein you can upload PDF, then you can customized it to have textboxes, checkbox. So we're kinda using DocuSign as a reference but still haven't figured out how they