• 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

Get orders by date and status woocommerce

Laravel: Why is my variable not being set while it's in the construct function of the controller?

How To Access A Column In M-M Relationship Table In Laravel

Undefined variable in Laravel 8 project (php 7.4)

How to make Canonicals with PHP

Do I need to install `fxp/composer-asset-plugin` if I'm not doing front-end development

Fatal error: [] operator not supported for strings

I need to link Google Sheet with my Laravel

Parameter is not sent to Laravel route in Ajax

How to implement placeholder in a php file for moodle plugin?

Explain how this array transposing and flattening function works

Laravel dosen't connect with Oracle

Error Class "LaravelFortifyFeatures" not found

How to modify CSS in a specific page of the WP admin dashboard (backend)

Popup Window and PHP form

About Contact Privacy policy Terms and conditions