Unable to stream pdf: headers already sent

Unable to stream pdf: headers already sent

i use dompdf to create pdf

and this my code
// Include autoloader
require_once 'dompdf/autoload.inc.php';
require_once 'dompdf/lib/php-font-lib/src/FontLib/Autoloader.php';
require_once 'dompdf/lib/php-svg-lib/src/autoload.php';
require_once 'dompdf/lib/html5lib/Parser.php';


// Reference the Dompdf namespace
use Dompdf\Dompdf;
use Dompdf\Options;

$options = new Options();
$options->set('defaultFont', 'Courier');
$dompdf = new Dompdf($options);

// Instantiate and use the dompdf class
$dompdf = new Dompdf();

// Load content from html file
$html = file_get_contents("http://********.com/pdf.php");

// (Optional) Setup the paper size and orientation
$dompdf->setPaper('A4', 'landscape');

// Render the HTML as PDF

// Output the generated PDF (1 = download and 0 = preview)

Open in new window

AHMED SAMYownerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Paul SmartSenior Support EngineerCommented:
What version of dompdf?


// Output the generated PDF to Browser
AHMED SAMYownerAuthor Commented:
i tried it not good i need to output data dynamic
Paul SmartSenior Support EngineerCommented:
What version?
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

AHMED SAMYownerAuthor Commented:
i removed it , can you give me link or method to export a dynamic php page with images
Paul SmartSenior Support EngineerCommented:
Try tcpdf
Of the pdf php creators out there this one is brilliant.
Very flexible and without knowing the exact project behind your requirements this should work well.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AHMED SAMYownerAuthor Commented:
ok thanks i will tryit now
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.