Forum Moderators: coopster

Message Too Old, No Replies

tcpdf problem

style CSS

         

bethesda

11:36 am on Dec 30, 2011 (gmt 0)

10+ Year Member



This is the second day of fighting with the style of CSS - trying to generate a page element with the displacement of directed number of pixels:

I try try to use (margin-left: XXpx)(paddng-left: XXpx)
Nothing .. Without changes to the site ..

Will there be someone who has used tcpdf?


$html = '
<img src="bg1.jpg" border="0" align="center"/>

<span style="margin-left: 70px;">Some test message :)</span>
<br />
<table border="1" cellspacing="3" cellpadding="4" width="500" style="margin-left: 70px;">
<tr>
<th>Lp.</th>
<th align="left">Nazwa zlecenia</th>
<th align="left">Vat</th>
<th>Cena</th>
</tr>
<tr>
<td>1</td>
<td bgcolor="#cccccc" align="center" colspan="2">A1 ex<i>amp</i>le <a href="#">link</a> column span. One two tree four five six seven eight nine ten.<br />line after br<br /><small>small text</small> normal <sub>subscript</sub> normal <sup>superscript</sup> normal bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla<ol><li>first<ol><li>sublist</li><li>sublist</li></ol></li><li>second</li></ol><small color="#FF0000" bgcolor="#FFFF00">small small small small small small small small small small small small small small small small small small small small</small></td>
<td>4B</td>
</tr>
<tr>
<td>'.$subtable.'</td>
<td bgcolor="#0000FF" color="yellow" align="center">A2 &#8364; &euro; &#8364; &amp; &#232; &egrave;<br/>A2 &#8364; &euro; &#8364; &amp; &#232; &egrave;</td>
<td bgcolor="#FFFF00" align="left"><font color="#FF0000">Red</font> Yellow BG</td>
<td>4C</td>
</tr>
<tr>
<td>1A</td>
<td rowspan="2" colspan="2" bgcolor="#FFFFCC">2AA<br />2AB<br />2AC</td>
<td bgcolor="#FF0000">4D</td>
</tr>
<tr>
<td>1B</td>
<td>4E</td>
</tr>
<tr>
<td>1C</td>
<td>2C</td>
<td>3C</td>
<td>4F</td>
</tr>
</table>
';


penders

12:41 pm on Dec 30, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



This sounds like a purely CSS problem? What does it have to do with tcpdf? - The code you have posted is standard HTML with a splattering of CSS.

Which element are you trying to position?

bethesda

5:12 pm on Dec 30, 2011 (gmt 0)

10+ Year Member



<span> or <table>

on HTML2PDF work's greate.

penders

8:15 pm on Dec 30, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Ah sorry, just twigged what you are getting at... you're trying to position an element inside a generated PDF document.

enigma1

9:51 am on Dec 31, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You will have to dig into the tcpdf internals and see if these inline styles are supported. I remember trying various things with inline styles then trying the pdf converts, including margins and padding but just few are supported.

bethesda

5:32 pm on Jan 1, 2012 (gmt 0)

10+ Year Member



You will have to dig into the tcpdf internals


And that will be where exactly ?

enigma1

6:06 pm on Jan 1, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It will be inside the tcpdf.php function getTagStyleFromCSS and where it this is called from where it processes inline html.

bethesda

7:28 pm on Jan 1, 2012 (gmt 0)

10+ Year Member



Ok, thanks for the tip ..