• 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

Symfony there are no commands defined in the "make" namespace

How to access a var with "-" in PHP [duplicate]

Why is this PHP array not the same?

get data-value with variable value

Create a new line whenever an array value reaches more than 10 characters

Edit product hook WooCommerce

Last order would be re-order in wooCommerce. How is it possible?

Correct way to use LIKE '%{$var}%' with prepared statements?

Laravel views are showing from cache on one server but works fine on other server

Laravel Gates using model and returns "Using $this when not in object context" Line 28 of AzureUser model

Converting array to string and then back in PHP

"There is no active transaction" when refreshing database in Laravel 8.0 test

how to get the header value, if we don't know the value because the value is random from the server

Upload a file Using PHP and JavaScript

Magento 2 - Controller returning blank page

About Contact Privacy policy Terms and conditions