• 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 fix Call to undefined method AppModelsTableName::factory?

Edit XML in HTML form and submit to self

Add 2 Webcam in one page with WebcamJS

GRPC installed successfully on ubuntu but php is looking for it in another folder

Querying only one row from a one to many relationship laravel

Modify microseconds of a PHP DateTime object

401 Unauthorized only occurring on some pages in Laravel 8

WordPress Subquery returns more than 1 row on SELECT

shell errors running php exec

Unable to get password for the instance created from AMI

Shopify password update using Shopify API

Xdebug in Laravel is not working with VSCode

How to Create WooCommerce Subscription Product via. REST API?

Convert regular text to array using notepad++

Reload parent page after submit in iframe

About Contact Privacy policy Terms and conditions