0

Hi

I am using fpdf.php to create a pdf from my php code.

However, my output needs to be in a table format and when I add this:

    $sMsg     = "
        <div align=center> <table  style='width: 900px;  color: black;  border: 1px solid DimGray;'> <tr> <td style='font-family: Arial;   font-size: 22px;   color: black;   width: 700px;' valign=top>
            ACORD™ CERTIFICATE OF LIABILITY INSURANCE
            </td> <td align='center' style=' font-family: Arial;   font-size: 15px;   color: black;border-left:1px solid DimGray; '> <b>Date (MM/DD/YY)</b><br/>
            $sTemp1
            </td> </tr></table>
        ";

I get this in my pdf:
How do I get this to properly format my html?

  <div align=center> <table  style='width: 900px;  color: black;  border: 1px solid DimGray;'><tr><td style='font-family: Arial;   font-size: 22px;   color: black;   width: 700px;' valign=top> etc.etc.
3
Contributors
4
Replies
17
Views
2 Years
Discussion Span
Last Post by Aeonix
0

You would make PHP file parse the data and write it in the file. There's this website that can convert HTML to PDF for you.

If you're looking for automated process. I would do almost same, except write the file in external HTML file and ask FPDF.php the parsed HTML file and parse to PDF. Given you already know how to use it.

0

Hi

Thank you for answering me.

I was able to successfully create an html file from my php output.

Now I need to automatically process this html file and convert it to a pdf

How do I do this?

0

You may take a look at this post. It gives you an idea of what other script you need in order to convert it from PHP to PDF. If you really want to implement it yourself, it will be a long process; besides, you will need to know how to encode/decode for PDF...

0

Now I need to automatically process this html file and convert it to a pdf How do I do this?

I am using fpdf.php to create a pdf from my php code.

Just use your FPDF.php, to create .PDF from your parsed .HTML file. After creating parsed HTML file, take it's name to FPDF.php and get PDF file out of it.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.