title: How do I generate an image file defined by CSS properties?
body: <p>Is there any way to create image file (jpeg or png) from some html DIV which is defined by CSS style properties.</p>
  
  <p>For Example:</p>
  
  <p><img src="https://i.stack.imgur.com/9uoGV.png" alt="div area on HTML page"></p>
  
  <pre><code>#canvas_base {
   width: 400px;
   height: 200px;
   background-color: #1155aa;
  }
  
  div.text_div{
   font-size: 15px;
   font-family: Tahoma;
   color: #770000;
   line-height: 19px;
   position: absolute;
   top: 76px;
   left: 114px;
   display: inline-block;
   -webkit-transform: rotate(0deg);
  } 
  img.image_div{
   position: absolute;
   top: 14px;
   left: 61px;
   display: inline-block;
   width: 240px;
   height: 240px;
   -webkit-transform: rotate(0deg);
  }
  </code></pre>
  
  <p>I'm working on a web application that users use to design their own business card.
  After submit they should recieve an jpeg mock-up sample (with designed business card) - something like this:</p>
  
  <p><img src="https://i.stack.imgur.com/OZKSL.jpg" alt="enter image description here"></p>
  
  <p>Can you give me some short guidance (name of PHP class, technology that should be used etc).</p>