Quantcast
Viewing all articles
Browse latest Browse all 1237

Client Side Signature of PDF in HTML Viewer returning the chnaged/signed PDF.

Hi,

 

I am generating a SFP PDF form which I then immediately save to a SAP PSRM Case.  I generate the PDF form 'fillable' and I have inserted a Signature Field in the form layout.

 

I have a requirement to save the signed form to the case once it has been signed.  This process should exclude saving the form to any application or presentation directories.

 

During the PSRM Case processing I can:

  • Successfully save the un-signed PDF to the Case
  • Successfully open the PDF via an HTML viewer
  • Successfully sign the PDF in the HTML viewer

 

The problem is when I return to the Case after the PDF has been signed I cannot save the signed PDF to the PSRM Case(SAP).

 

I am using the code below to display the un-signed PDF in the HTML Viewer

 

* Convert xstring to binary table to pass to the LOAD_DATA method

   CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'

     EXPORTING

       buffer     = g_pdf_content_in

     TABLES

       binary_tab = gt_data.

 

 

* Load the HTML

   CALL METHOD g_html_control->load_data(

     EXPORTING

       type                 = 'application'

       subtype              = 'pdf'

     IMPORTING

       assigned_url         = lv_url

     CHANGING

       data_table           = gt_data

     EXCEPTIONS

       dp_invalid_parameter = 1

       dp_error_general     = 2

       cntl_error           = 3

       OTHERS               = 4 ).

 

* Show it

   CALL METHOD g_html_control->show_url( url = lv_url

     in_place = 'X' ).


I assume that 'gt_data' would now represent the signed PDF? How do I convert 'gt_data' back to a PDF xstring? I have tried:

  •   FM 'SCMS_BINARY_TO_XSTRING'
  • Various Methods in Class 'CL_BCS_CONVERT'

 

All with no success.  Either it saves the un-signed PDF to the PSRM Case or the PDF cannot be viewed as it is corrupt.

 

Please help.

 

Warm Regards

 

Waheeb


Viewing all articles
Browse latest Browse all 1237

Trending Articles