2

I am trying to make an image editor kind of page. Person can add text and styles to the background image. Everything i have done through HTML, Jquery and css, but struck up with export it to an image. I want to convert the particular div into image.

Note: I already know HTML to image conversion is possible through SVG and HTML5 Canvas. I cannot do those things because of browser compatibility.

If any PHP classes or jquery plugin is available please help me.

Arun Singh
  • 1,538
  • 4
  • 19
  • 43
Akilan
  • 1,707
  • 1
  • 16
  • 30

1 Answers1

0

I think it is not possible without HTML5 features on the client side directly. May be I wrong?

My solution is to send the entire div (with styles) to backend server, where capture a screenshot with PhantomJS or Qt Webkit. On the server side you shoold open the DIV user created as it displayed in user browser and then make screenshot of this DIV.

odiszapc
  • 4,089
  • 2
  • 27
  • 42
  • how can i convert the div to image. I can send the entire styles to server but i cant do the image conversion. – Akilan Jun 16 '12 at 11:05
  • Let me explain. User has drawed the meta-image. This is a set of HTML entities. Then all user drawings has been send to server (coordinates of drawing entities). This is like recording macros in Photoshop. All user actions has been send to server. You backend code then must regenerate some html that when opened should displayed exactly as what user has drawed like "you backend code launch a browser and see result" Then you can use the Qt Webkit to programatically open this generated html-page via Webkit engine and capture screenshot. Cutycapt can helps you. – odiszapc Jun 16 '12 at 11:12