Link to home
Start Free TrialLog in
Avatar of doctorbill
doctorbillFlag for United Kingdom of Great Britain and Northern Ireland

asked on

DOM pdf error

error when using dom pdf to generate pdf files from php records:
Unable to stream pdf: headers already sent

I have tried all the typical suggested solutions for this but I still get the error
I haven't posted any code yet because I am unsure of exactly what to post
I initially post this error in case anyone has a suggestion of whet the error is actually telling me / doing in terms of code
I am pretty sure it used to work on my server but I have not visited my code for some time so I just cannot remember if anything has changed
Avatar of gr8gonzo
Flag of United States of America image

This is because you have code that is trying to set HTTP headers, but the HTTP headers have been sent already.

This is the same error as the PHP one:
Warning: Cannot modify header information - headers already sent

...which I cover in my article:

Basically, ANY output at all, even a line break or a single space, will tell PHP / the web server that you're done with the headers portion of the response and you're moving onto the body of the response. So more often than not, this is just a line break somewhere in an included / required file.
Avatar of doctorbill


Attached files:

This file is the source file and the links "Create Individual PDF" sends "id2" data to the following page:

This file uses the dom pdf files and has the following file as an include:

Can you see where the issues may be?
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Once again - thanks all