cancel
Showing results for 
Search instead for 
Did you mean: 

Showing image on pdf through ABAP webDynpro

0 Kudos

Dear Experts,

My objective is to show an image on the adobe pdf through ABAP webDynpro.

I created a Form with context parameter im_pic which is an image field and also a title.

In WDA, I have the image as imported mime object and the context has an xstring attribute for the image.

I used the following code to feed the adobe form from WDDOINIT.


  DATA lo_nd_ztest_pic TYPE REF TO if_wd_context_node.
  DATA lo_el_ztest_pic TYPE REF TO if_wd_context_element.
  DATA ls_ztest_pic TYPE wd_this->element_ztest_pic.
  DATA: mr      TYPE REF TO if_mr_api,
            content TYPE        xstring,
            url     TYPE string VALUE 'sap/bc/webdynpro/sap/ztest_pic/test.bmp'.
* From code wizard 
  lo_nd_ztest_pic = wd_context->get_child_node( name = wd_this->wdctx_ztest_pic ).
  lo_el_ztest_pic = lo_nd_ztest_pic->get_element( ).
  lo_el_ztest_pic->get_static_attributes(
    IMPORTING
      static_attributes = ls_ztest_pic ).

* get content of the image from mime rep 
  mr = cl_mime_repository_api=>get_api( ).
  mr->get( EXPORTING  i_url     = url
           IMPORTING  e_content = content ).
  ls_ztest_pic-im_title = 'Test'.
  ls_ztest_pic-im_pic = content .

  lo_el_ztest_pic->set_static_attributes(
    EXPORTING
      static_attributes = ls_ztest_pic ).

I donu2019t see the image in the ADOBE pdf output. This get method returns the content as empty.

Is there any problem in the way I am passing the url? Any idea what might be wrong here?

Thanks for your help and advice.

Best regards, Rajib

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member188831
Contributor
0 Kudos

Dear Rajib,

you can used adobe life cycle designer software after installing this on your machine using SFP tcode , place your image on layout.

then link it in adobe interactive forms element on webdynpro view.

hope you can do this way.

all the best ...

Regards,

Mahesh.Gattu

0 Kudos

Hi Mahesh,

I already created a form using txn SFP and image layout and context in the adobe life cycle designer and the image container is linked to the webdynpro view element.

Still there seems to be some problem somewhere.

Thanks, Rajib

Former Member
0 Kudos

Hi,

How u have designed the Adobe forrm, did u used the Image Ui element or the Image field UI element, both these elements uses the property called href ( calls the url images or the desktop path ). now try to bind the image field href to context node attribute and try to pass the desktop image ,

Regards

Vikranth