• 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

Call to a member function fetch_field() on a non-object MySQLiDB

Laravel Passport - Not able to get token string in response?

Check If array is null or not in php

Xdebug in Laravel is not working with VSCode

PHP: remove filename from path

PHP: How to raise number to (tiny) fractional exponent?

Laravel 5: Is there a non-case sensitive way to sort a collection by an attribute?

PHP header location absolute URL

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

Check if string contains a value in array [duplicate]

How to submit the custom form data in database in WordPress without plugin using ajax?

Use same method for inertia response and json response Laravel Jetstream

php - add comma thousands separator but remove trailing zeros

How can I get data from PHP to Android TextView?

PHP Sorting - getting 10, 11, 12 ... 1, 20, 2 rather than 1, 10, 11, 12 ... 2, 20

About Contact Privacy policy Terms and conditions