symfony1 - Write variable PHP with TCPDF -
I have to generate a PDF with TCPDF, my information comes from my database, so I have to type the PHP variable. I know how to do it.
But I want to write CSS + XHTML (as an example I have seen TCPDF site):
$ html = & lt; & Lt; & Lt; EOF & lt; Style & gt; & Lt ;! - My CSS - & gt; & Lt; / Style & gt; & Lt ;! - My xHTML - & gt; EOF; $ Pdf- & gt; Write HTML ('$ html', '');
I have errors while trying to open PDFs. I have read that I have to save '$' from '\'. After this, I have no errors, but the content of my variable does not appear in my PDF.
Edit:
@Sarfraz: I don do I do this so how can I do this, does not it work?
$ html = & lt; & Lt; & Lt; EOF & lt; Style & gt; & Lt ;! - My CSS - & gt; & Lt; / Style & gt; & Lt ;! - My xHTML - & gt; & Lt; Span & gt; & Lt ;? Php echo $ myVar; ? & Gt; & Lt; / Span & gt; EOF; $ Pdf- & gt; Write HTML ('$ html', '');
Be sure that has no place and indent before EOF;
Otherwise you will get the error.
In addition to this, if you have any variables to avoid headococryte syntax, then they should be {}
like {$ somevar}
/ P> />
Comments
Post a Comment