• 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 validate Envato Purchase Code in PHP

Facebook PHP SDK - will not logout properly

Printing more than one array using print_r or any other function in php

How to increase the PHP upload limits [duplicate]

using random function but it's displaying duplicates

Vimeo API: how to save a vimeo into a subfolder?

cakephp save drag and drop list order to database

Reorder attribute dropdown terms in Woocommerce single variable products

Why i get wrong output for html markdown?

Handle error for duplicate entries - PHP/MySQL

How to delete old images from public folder on update using Laravel

How to generate QR CODE for dynamic generating link and logo using Simple QrCode in laravel?

Autoloading classes in PHPUnit using Composer and autoload.php

How to install PHP composer inside a docker container

Inserting Country Selection into MySQL PHP [duplicate]

About Contact Privacy policy Terms and conditions