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

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.