• 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

WordPress - Dynamically add user ID to the end of a URL

Laravel update hasMany relationship using saveMany

zsh: command not found: php

Symfony Mercure "Failed to send an update"

Magento 2 - How to add new block to admin panel in product page?

How to get total pages of PDF with FPDF?

PHP contact form configuration [duplicate]

Laravel csrf token mismatch for ajax POST Request

Android Volley getParams() method not getting called for JsonObjectRequest

Appending data to an anchor tag

Implode array with array of glue strings

Correctly determine if date string is a valid date in that format

How do I truncate a decimal in PHP?

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

How to install LDAP in Docker php-fpm alpine

About Contact Privacy policy Terms and conditions