$mpdf = new \Mpdf\Mpdf([
'tempDir' => __DIR__ . '/temp'
]);
$mpdf->SetMargins(0, 0, 0); // will set it to 0 for all pages.
是否可以为PDF页面的第1页提供0的页边距,为文档的其余页面提供默认的页边距?
我目前正在用7.0版来测试这一点。
我尝试在中找到解决方案,但我无法找到合适的解决方案。
实际上源pdf在第一个pdf页面中添加/写入一行,但它总是在输出中返回1个pdf页面,其余的页面都消失了。非常奇怪的问题。实际上我的PDF有多个页面。
这是我的代码。
require_once APPPATH . './libraries/mpdf/vendor/autoload.php';
if (ob_get_contents()) ob_end_clean();
$Text = "This score is for Mr. John Deo";
$mpdf = new \Mpdf\Mpdf();
$mp
我用Mpdf创建了一个有3页的pdf文档,第一页和第三页总是包含数据,而第二页则依赖于此。我不想显示第二页,如果它的数据是空的 下面是代码结构 html = 'some html code to be printed on pdf'; //1st Page
$result[] = $html;
html2 = 'some html code to be printed on pdf'; //2nd Page (It might be empty)
$result[] = $html2;
// if($pdfdetails['Test'
我使用在Yii2中创建PDF。我有我的第一页,但我需要添加一个分页,并确保我开始第二条信息在一个新的页面。我不知道该怎么做。我试过:
public function actionReports()
{
$data = date('d F Y',time());
$content = $this->renderPartial('_billing', [
'model' => $data,
]);
$doc = new Pdf([
// set to use core fonts only