• 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 a user out of a website when they put their computer to sleep

Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this?

PHP Download MP3 files from directory on server

laravel controller function parameters

Unable to run composer install

How can I solve "laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system"?

Telegram bot doesn't answer

Using PHP to connect to a remote MSSQL database

PHPS source file - 403 Forbidden You don't have permission to access this resource

google content api for shopping

How to get monthly wise data in laravel

SQLSTATE[HY000]: General error: 1 table posts has no column named *

How can I create a Download Page with post php method?

Sum column values from multiple arrays

Extract house numbers from address string

About Contact Privacy policy Terms and conditions