title: Oracle Apex Canvas to blob in PNG format saved to item
body: <p>I am struggling to convert my canvas URL to a blob format, specifically in PNG format. The DataURL is generating quite perfectly when I tested it without the conversion code, the problem comes in when trying to convert it to Blob. I am using an html button that triggers the JavaScript function with the ID buttonTextArea. </p>
  
  <p>I need the Blob file to be linked to my APEX page item, which I use the $s('P9_IMAGE_CODE', Blob) format, which also works when I tested it using text only. Once the page is processed, that item will be sent into a blob column within my table. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>$("#buttonTextArea").click(function(dataURL) {
  var BASE64_MARKER = ';base64,';
  var canvas  = document.getElementById('myCanvas');
  var dataURL = canvas.toDataURL();
      if (dataURL.indexOf(BASE64_MARKER) == -1) {
         var parts = dataURL.split(',');
         var contentType = parts[0].split(':')[1];
         var raw = decodeURIComponent(parts[1]);
  
           return new Blob([raw], {type: contentType});
  }
  
           var parts = dataURL.split(BASE64_MARKER);
           var contentType = parts[0].split(':')[1];
           var raw = window.atob(parts[1]);
           var rawLength = raw.length;
  
           var uInt8Array = new Uint8Array(rawLength);
  
              for (var i = 0; i &lt; rawLength; ++i) {
              uInt8Array[i] = raw.charCodeAt(i);
  }
  
       return new Blob([uInt8Array], {type: contentType});
       document.getElementById("textArea").value = dataUrl;
  
  
      $s('P9_IMAGE_CODE', Blob); --P9_IMAGE_CODE IS THE ITEM ON MY PAGE
  </code></pre>
  
  <p>});</p>
  
  <p>I have been trying examples from :
  <a href="https://github.com/blueimp/JavaScript-Canvas-to-Blob/blob/master/README.md" rel="nofollow">https://github.com/blueimp/JavaScript-Canvas-to-Blob/blob/master/README.md</a>
  and
  <a href="https://code.google.com/p/chromium/issues/detail?id=67587" rel="nofollow">https://code.google.com/p/chromium/issues/detail?id=67587</a></p>
  
  <p>Thank you in advance.</p>