Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Converting PDF file contents to base64Binary format

santhosh_sontha2
Explorer
0 Likes
1,817

Hi All,

I have a requirement where I need to convert PDF form contents to base64Binary format and call the webservice to send it to outside world.

Detail Description:

I have two buttons on my application one "DISPLAY" & another "SEND". If user clicks on 'DISPLAY' then PDF form will be opened and printed. If user clicks "SEND" button then PDF form contents should be converted to base64Binary format and proxy class will be called to send to PI server. Please let me know any function modules or codes for converting PDF form contents to base64Binary format.

Your inputs on this will be highly appericiated.

Regards,

Santhosh

Edited by: santhosh sontha on Dec 21, 2010 12:23 PM

1 ACCEPTED SOLUTION
Read only

brad_bohn
Active Contributor
0 Likes
1,077

Use fm SSFC_BASE64_ENCODE. You'll need to convert the data to XSTRING format first.

Hi All,

I have a requirement where I need to convert PDF form contents to base64Binary format and call the webservice to send it to outside world.

Detail Description:

I have two buttons on my application one "DISPLAY" & another "SEND". If user clicks on 'DISPLAY' then PDF form will be opened and printed. If user clicks "SEND" button then PDF form contents should be converted to base64Binary format and proxy class will be called to send to PI server. Please let me know any function modules or codes for converting PDF form contents to base64Binary format.

Your inputs on this will be highly appericiated.

Regards,

Santhosh

Edited by: santhosh sontha on Dec 21, 2010 12:23 PM

5 REPLIES 5
Read only

brad_bohn
Active Contributor
0 Likes
1,078

Use fm SSFC_BASE64_ENCODE. You'll need to convert the data to XSTRING format first.

Read only

0 Likes
1,077

Hi Brad,

Thanks for your answer. Please let me know any function moudles avliabe for converting PDF form contents to XSTRING format.

Read only

brad_bohn
Active Contributor
0 Likes
1,077

You can try one of the functions in function group SCMS_CONV (or search for others in SE37). My standard process uses older code which still works with SX_TABLE_LINE_WIDTH_CHANGE, then SO_SOLITAB_TO_SOLIXTAB, then


* Convert to XSTRING format
  LOOP AT gt_pdf_255x INTO gs_pdf_255x.
    ASSIGN gs_pdf_255x TO <fs_line> CASTING TYPE x.
    CONCATENATE e_pdfout <fs_line> INTO e_pdfout IN BYTE MODE.
  ENDLOOP.

Read only

0 Likes
1,077

Hi Brad,

FYI my requirement is not to send PDF document as attachment. Instead I need to call the webservice in which "File contents" should be sent in one of the field of type < XSD: base64Binary>. Sorry I am very much new to PDF forms, please let me know how to pass file contents as input to SX_TABLE_LINE_WIDTH_CHANGE function module.

Thanks...........

Read only

brad_bohn
Active Contributor
0 Likes
1,077

I never said anything about attachments - the process I gave you was for converting binary PDF from the function to XSTRING format so that it can be base64 encoded. The actual code should be obvious from the functions - I will not spoon feed you that code. You need to try to figure it out yourself first. You don't seem to be making any effort on your own yet...