• 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

TesseractOCR not working for Laravel

Unable to run composer install

Applying programmatically a coupon to an Order in WooCommerce3

How do I loop through an MS SQL database with VB.NET?

Xdebug in Laravel is not working with VSCode

Nginx disallowing execution of PHP in uploads directory with Magento

Google API Heatmap Layer exception, why?

Add custom text under order details on WooCommerce My account view order pages

PHP sort array of objects by two properties

OctoberCMS / Anonymous Global Scope

Is it possible to re-use an array taken from PHP via JSON in a $.ajax function?

Display the WooCommerce product price inside a custom function

Adding hreflang tags automatically in WordPress subdirectory multisite

"properties should not be accessed directly" issue during WooCommerce 3.0 checkout

How to auto populate preferredCountries from intl-tel-input with db output

About Contact Privacy policy Terms and conditions