I have a php page that generates a pdf using mpdf (php to pdf).. So when the users goes to this page the pdf is generated.. I have decided that rather then output the pdf to the browser I will email it to them.. That is all fine and works great.. So at the end of the pdf generating code I put the code for the html page to show.. Like a brand new page.. All works perfectly except for in IE.. where the layout is all messed up.. BUT if I put the html code before the pdf generating code it all looks fine.. and if I put the html in its own page it all looks fine.. Something in the pdf generating code is messing with IE..
So question is.. What about if I link the pdf generating page to the html page..
ie have two pages.. one php page with the html code saying what I want displayed.... and then link to the pdf generating code.. like include("pdfpage.php"); Include won't work, but anything else? Function?
Ideas? Stuck.
Thank 开发者_高级运维you
You might try to wrap your PDF generation code up and try to not let it interfere with your HTML page.
A starting point is ob_start(). You can start an output buffer before generating your PDF . That captures any output your PDF generation code might produce. You can then have a look at it, dispose of it or do whatever you like with it.
That way, no left-overs will be interfering with your HTML page.
精彩评论