Reputation: 1658
Is it possible to convert the html contents including styles to image by php. Please guide me.
Upvotes: 0
Views: 372
Reputation: 57650
Well, you need to render it first. For rendering you need something like browser which can handle js, CSS etc. after rendering you take the image. Php is not yet capable of doing such things. But you can achieve it by creating a php extension that uses browser engine and do the task for you. The extension will be like a bridge.
There are many browser engines. Among them you can use webkit. It renders quite fast. I Prefer it.
Another thing to know. This extension will take a lot CPU and memory in compared to normal php script.
Upvotes: 1