• 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

Creating command to backup MySql database in Laravel

PHPExcel export HTML table to xlsx

Remove categories with all childs derived from parent category

Required field only if another field has a value, must be empty otherwise

PHP | "The requested PHP extension bcmath is missing from your system."

Create a zip file and download it

How to skip cart page on woocomerce for certain products only?

How to reset Laravel AuthManager/guards in between API calls in tests?

PHP contact form configuration [duplicate]

google content api for shopping

How to pass security cloudflare server with php curl

is there any way to validate a field that sometime is File(image) && sometime is String(Src of same image)

add " ? " in url via htaccess RewriteRule

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

How to add a custom field to all Woocommerce attribute terms using add_action

About Contact Privacy policy Terms and conditions