• 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

java URL working on browser but not in client program

What is PHP's equivalent of JavaScript's "array.every()"?

Send POST data via raw JSON with Postman

Fatal error: Trait 'LaminasDbAdapterLaminasDbAdapterAdapterInterface' not found in /var/www/vendor/laminas/laminas-db/src/Adapter/Adapter.php

PHP using str_starts_with for array to exclude same as with wildcard

protect my blog content

Zig-zag scan an N x N array

PHP only Hit Counter?

How to Make Laravel Eloquent "IN" Query?

How to install LDAP in Docker php-fpm alpine

Laravel csrf token mismatch for ajax POST Request

PHP -> Next nearest date defined by array of days in week

How to create custom authentication in laravel 8?

error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure

Passing a boolean value from checkbox in Laravel form

About Contact Privacy policy Terms and conditions