6 Replies Latest reply on Apr 17, 2011 1:40 AM by sky123


      Hi all,
      User is asked to sign the form.I am using jquery plugin to get signature http://www.unbolt.net/jSignature/ the problem is when I want to insert these data to DB.it gives me an error invalid hex number.What I do is I have P3_SIGNATURE_IMAGE as my blob column in DB.then I have a hidden column P3_SIGNATURE which gets its value from after region item value computation
      :P3_SIGNATURE := ('#signature1').jSignature('getData'); --->it gives hex value
      after that I have a process on submit before computation to assign
      it gives me invalid hex value or when I do some modification like when I change P3_SIGNATURE to db column it insert null to DB.Any idea???

      Thank you in advance.
        • 1. Re: e-signature
          how abt converting the hex to blob
          :P3_SIGNATURE_IMAGE := utl_encode.BASE64_ENCODE(utl_raw.cast_to_raw( :P3_SIGNATURE))
          1 person found this helpful
          • 2. Re: e-signature
            Hi Vee,

            It gives me an error bad argument.
            Thank you
            • 3. Re: e-signature
              The problem is solved I changed the blob type to varchar2(4000) and now the problem is with my interactive report that shows char.how can I get back my image?
              Thank u so much
              • 4. Re: e-signature
                How do I capture the image and save it as BLOB. This way I can apply the image to printed document.

                • 5. Re: e-signature

                  When you get the base64 value, you need to convert it into a blob.

                  There is a function in the APEX_WEB_SERVICE API that can do this, APEX_WEB_SERVICE.CLOBBASE642BLOB http://download.oracle.com/docs/cd/E17556_01/doc/apirefs.40/e15519/apex_web_service.htm#BABHIEJB

                  Couple of issues though - the Base64 value is likely larger than 32k, which APEX doesnt support submitting to the server, so you need to use AJAX to submit the value into a collection. Carl blogged about a way to do this: http://carlback.blogspot.com/2008/04/new-stuff-4-over-head-with-clob.html

                  Next issue, is the base64 string captured a canvas is in the format : data:image/png;base64,<base64> where image/png is the mime type. So when you convert the data to a blob, you don't wanna to pass the data:image/png;base64, into the function to convert. The way I did it was:
                       select substr(clob001, instr(clob001, ',')+1, length(clob001)) into l_clob
                       from apex_collections
                       where collection_name = c_collection_name;
                  as the base64 string begins after the comma.

                  (You probably also want to extract the mime_type using a similar technique)

                  so then you can call
                  l_blob := apex_web_service.CLOBBASE642BLOB(l_clob);
                  Well that should be a good starting point for you.

                  • 6. Re: e-signature