PHP - mPDF resolution

Is it possible to set the resolution of a PDF file using the mPDF class. I am trying to save an image that is mostly black, but with some thin white lines, and I do not see these white lines in PDF, so I assume that I need to increase the resolution.

EDIT:

This is my code. First I save my page as html:

<?php $fileID = uniqid(); $_SESSION['fileID'] = $fileID; file_put_contents("$fileID.html", ob_get_contents()); header("Location: createPDF.php"); ?> 

then I convert this page (which is full of svg images) to pdf:

 <?php include 'MPDF57/mpdf.php'; session_start(); $fileID = $_SESSION['fileID']; $yourHtml = "$fileID.html"; $mpdf=new mPDF('', '', 0, '', 0, 0, 0, 0, 0, 0); $mpdf->SetDisplayMode('fullpage'); $mpdf->WriteHTML(file_get_contents('main.css'),1); $mpdf->WriteHTML(file_get_contents($yourHtml)); $mpdf->Output(); unlink($yourHtml); unset($_SESSION['fileID']); header("index.php"); exit; ?> 

Now I need to know if there is a way to change the resolution of the PDF file.

+4
source share
1 answer

I had this problem before I solved it by changing the variables in config.php

 $this->img_dpi = 96; // Default dpi to output images if size not defined 

I added a large image and changed the dpi, it worked.

+2
source

Source: https://habr.com/ru/post/1501020/


All Articles