• 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

Display the default discounted price and percentage on Woocommerce products

wordpress : How to specify the cause "This site can’t be reached"

PHP Find Array Index value in multi-line array

PHP header location absolute URL

Apply session id from request header

How to run or debug php on Visual Studio Code (VSCode)

Lexik JWT authentication problem "Invalid credentials"

How can I make good efficent AJAX live forms with just jQuery and

Laravel Displaying image from database

How to break out of a foreach once a condition is met?

Is there an equivalent of DynamoDB on Azure as a PHP session Handler

PHP: Insert marker every 3 iterations

How to create custom authentication in laravel 8?

Symfony/Form add attribute based on the data

php code to send checkbox form results to email

About Contact Privacy policy Terms and conditions