• 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

disable two buttons after clicking another button

How to create laravel storage symbolic link for production or sub domain system?

PHP DOTENV unable to load env vars

LARAVEL: How to fetch id dynamically in a query builder?

Using PHP to connect to a remote MSSQL database

php curl requesting twice

Not able to override collapsible.js in magento 2

MySQL upgrade causing unexpected results on simple WHERE clauses

Custom API and cunsuming in php?

Shortcode or PHP inside a shortcode in Wordpress

Is it possible to change the table name in the migration file-laravel

How to create custom authentication in laravel 8?

Doctrine ORM: Excluding Records Based on Values of Nested Relationships

AJAX call fails with SyntaxError: Unexpected end of JSON input

PHP-Sort array based on another array?

About Contact Privacy policy Terms and conditions