mPDF Manual – mPDF functions

SetCompression()

(mPDF >= 1.0)

SetCompression – Specifies that mPDF should compress the data for the PDF file

Description

void SetCompression ( boolean $flag )

Specifies that mPDF should compress the data for the PDF file. This makes a smaller PDF file and is set by default to true on initialising the mPDF class.

Parameters

$flag

true or false to specify whether mPDF should compress the data for the PDF file.

Default: true

Examples

Example #1

<?php
$mpdf = new \Mpdf\Mpdf();

$mpdf->SetCompression(false);

$mpdf->WriteHTML('
Hello World
');

$mpdf->Output('filename.pdf');

Fork me on GitHub