• 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

How to check user Permissions using Custom Middleware in Laravel

Uncaught TypeError: Cannot read property 'length' of null when retrieving tags from wp

How to find the date a user created their Google account

Sort a multidimensional array by integer inside of a string value which is two levels down

How to get company posts from LinkedIn via API?

How to give apache permission to write to home directory?

PHP Warning: Module already loaded in Unknown on line 0

is there any way to validate a field that sometime is File(image) && sometime is String(Src of same image)

PHP returning an error message and false

How do I pass the dynamic output of a php variable or php function to a CSS variable?

WooCommerce Additional Information - if empty, hide

Prestashop cUrl Login

How To Access A Column In M-M Relationship Table In Laravel

curl returning 301 error after migrating to https

Not able to override collapsible.js in magento 2

About Contact Privacy policy Terms and conditions