• 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

Insert a DIV after the 6th product only once in WooCommerce category archives

Cannot pass null argument when using type hinting

Show Custom Data in Woocommerce Order Details Admin Area

How to change product Image when variables are selected in Shop and Archive Pages?

Use same method for inertia response and json response Laravel Jetstream

I can't delete my image when it is liked because of the foreign key in mysql

What's the net::ERR_HTTP2_PROTOCOL_ERROR about?

How do I do HTTP basic authentication using Guzzle?

How to downgrade or install a specific version of Composer?

jwt decode throws Invalid argument supplied for foreach() on php-jwt and codeignitor 4

Warning: sqlite_query() expects parameter 1 to be resource, string given

Minimum order amount except for specific shipping method in WooCommerce

Symfony run hint kernel.secret parameter not found

Currently Using CodeIgniter Framework i have an Error

Comma separated list from array with "and" before last element

About Contact Privacy policy Terms and conditions