0
votes

I'm building Joomla component and I want to save generated admin table as PDF file using Joomla PDF document class, that uses TCPDF library.

Now I have managed to get the table contents, and save it as PDF, but for some reason table width is exceeding page width.

I have tried everything, external css, inline css, but it simply doesn't read my styles and outputs the table with no styling. The table has 5 columns and I can only see first 3 of them, even if just write single character in each column.

This is the html that I tried to output as PDF:

<table style="width:300px;">
<tr style="height:120px;">
    <td style="border:1px solid #000000;width:200px;color:red;">1</td>
    <td>2</td>
    <td>3</td>
    <td>4</td>
    <td>5</td>
</tr>
</table>

And what I get in output PDF is just: 1 2 3 So values 4 and 5 are outside of page.

Please help I've been struggling with this for past few hours. Thanks!

1
I don't suppose adding !important after the width helps does it?Lodder
@Lodder Unfortunately no!kruno

1 Answers

0
votes

Don't know if this qualifies as an answer.

I have solved it by uploading latest version of TCPDF library, but it seems that joomla 1.5 has some problems with it I didn't used Joomla PDF library (it is actually just extending TCPDF with limited options), but instead I loaded TCPDF library directly in my code and everything worked great.