• 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

MySQL/PHP - Web Based Game -User specific inventory table or 1 giant table? Another option?

Laravel unique validation on multiple columns

image source not readable

PHP usort() order in case of equality

Laravel 5 issue with wherePivot

Webscraping Symfony/Panther: Can't get HTML

PHP Startup: Unable to load dynamic library 'openssl' in Ubuntu

Find out the name of the last script that included the current one

IlluminateDatabaseQueryException could not find driver [duplicate]

Performance of foreach, array_map with lambda and array_map with static function

Laravel Factory not calling callback 'afterCreating'

Laravel views are showing from cache on one server but works fine on other server

run a query using EXECUTE BLOCK to prepair a column for an unique-Index

how to use extended ASCII instead of unicode in PHP

Symfony Error: "An exception has been thrown during the rendering of a template"

About Contact Privacy policy Terms and conditions