Hi guys,

We have a custom-written online invoicing system, written in PHP. Right now, it generates an HTML invoice (with CSS etc) and sends that to the clients as an HTML mail, but since a lot of mail clients regard it as spam, disable functionality and images, or just completely disregards the CSS, we have decided to rather send the clients the invoice in PDF format.

The problem, however, is to convert the generated HTML table to a PDF. We have tried countless packages/libraries, without success (they all screw up with the CSS somewhere along the line). So, how about a workaround like this:

Save the table (or the entire HTML page output) as an image file, whether it's a JPEG or BMP, probably doesn't really matter. Then create a new PDF and insert the newly created image into the PDF doc. Thus retaining its look (and disabling text selection, which we really don't care about anyway).

Is that possible? Or is there any other good way to convert our HTML invoices to PDF?

Recommended Answers

Hey,

I had to do basically the exact same thing. You can use the TCPDF PHP library - it's really simple and can use basic HTML and in-line CSS to create and style tables for input :)

Jump to Post

All 4 Replies

I have used HTML2PDF quite successfully for copying schedules to PDF files. I had to tweek the html a bit at the start but it has been working like a charm for quite a while now. I have added my notes on it here.

Thanks for the replies!

Would probably best continue this in the C# forum, as the accounting guys now decided they want the invoicing system to run from their current admin system (which is an app written in C#) rather than from a PHP admin-site. Hate these flash decisions...

Use ADOBE acreate professional. Can ceate PDF files.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.