• 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 set dynamic `home` and `siteurl` in WordPress?

How to get Laravel's CSRF Token from Another Website?

Laravel - Browser displays message again when I press back button

Debugging Stripe Webhook Event

How to pass data to all views in Laravel 5?

(Laravel) How to delete multiple models including optional relationships?

Best way to scrolldown onpageload

Custom add to cart button URL for specific product in WooCommerce?

PHP Form Not Inserting

Check If array is null or not in php

Render the content of default_filter.php in Joomla front-end

Python - Include another Python script

How to test a php login connected to a mysql db through xampp?

Symfony - "framework.test" config is not set to true

Lumen - Postgresql setup - Composer

About Contact Privacy policy Terms and conditions