title: Merge signature image onto a pdf loaded in a div
body: <p>For a project I need to load a pdf file onto a div. On clicking a button a canvas will be opened where the user will draw his signature and then on clicking the add button present in the canvas, the user should be able to place the canvas signature as an image on to the pdf. At last on clicking the final button the image should get merged onto the pdf.</p>
  
  <p>I did the above task in the following way:</p>
  
  <ol>
  <li>Converted pdf into series of images using GhostScript.</li>
  <li>Loaded the converted images onto a div.</li>
  <li>On clicking the button a canvas will be opened and the user will sign in it and on clicking the add button present in the canvas, the user will be able to place the image onto the image of pages loaded in the div.</li>
  <li>I obtain the page Id which is the page number and the signature image placed coordinate using e.clientX and e.clientY.</li>
  <li>Then I pass all those 3 values to a php script which uses fpdf and fpdi to merge the image onto the pdf.</li>
  <li>I'm not able to place the image properly because e.clientX and e.clientY makes use of pixel as units where as fpdf uses mm as units. I'm trying to sort out that.</li>
  </ol>
  
  <p>Is there any other way to do this in a simpler way. i.e., directly loading the pdf onto the div and merging the signature instead of what I've explained above.</p>