• 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

Log file is not being written in Laravel 5.5

PHP Find Array Index value in multi-line array

Loading data from MySQL and populating dropdown select with jQuery Mobile, PHP

Currently Using CodeIgniter Framework i have an Error

The sum of the user's points

Stop caching for PHP 5.5.3 in MAMP

Transpose and flatten two-dimensional indexed array where rows may not be of equal length

How to write PHP in XSLT

image source not readable

SendGrid: Sending an email to multiple recipients without other emails being shown on the "to" field

How to install php_imagick on wamp64

Laravel lang slug in url

Issue with laravel eloquent model property

nginx err_connection_refused, can anyone help me?

Composer Curl error 60: SSL certificate problem: unable to get local issuer certificate

About Contact Privacy policy Terms and conditions