• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

How to fix 'Data has already been sent to output, unable to output PDF file' in MPDF

phppdf-generationmpdf


PHP Snippet 1:

ob_start();

PHP Snippet 2:

ob_end_flush();

require_once __DIR__ . '/vendor/autoload.php';

$mpdf = new \Mpdf\Mpdf();
$mpdf->WriteHTML($html);
$mpdf->Output();

Related Snippets

How to programmatically find public properties of a class from inside one of it's methods

if statement inside concatenation

Add New Parameter to Existing URL using htaccess

how to identify the web server name of remote host

Laravel 5: Is there a non-case sensitive way to sort a collection by an attribute?

Laravel s3 upload file with metadata using pre-signed url

Sync Records With Default Values in Pivot Tables, Call to undefined method syncWithPivotDefaults()

PHP - Check if string contains words longer than 4 characters, then include "+ *", and for those shorter than 4 characters include only "*"

WordPress Subquery returns more than 1 row on SELECT

How to give apache permission to write to home directory?

protect my blog content

how to insert data into select2 search input after scan using qrcode

printing all running session variable in laravel 5.1

yii2 and mssql insert varbinary into model

PHP Deprecated issue when running artisan command

About Contact Privacy policy Terms and conditions