cancel
Showing results for 
Search instead for 
Did you mean: 

How to fix Image display in Adobe Forms ?

Former Member
0 Kudos

Hello guys..

I have created a Chart with cl_gui_chart_engine using XML. Then I have converted this to if_ixml_document and created a chart with cl_igs_chart_engine so I could take the Image of the chart.

I took the image of the chart, created an Adobe Form... long story short: I was able to export the Image to Adobe Form and displayed it!

But there is a problem, the image isn't displayed well:

Image:

http://img22.imageshack.us/img22/5403/syft.png

Sorry but I couldn't upload an Image here i don't know why.

As you see in the Image, I used the 3 options of Sizing that is in Adobe Forms but still it doesn't show the image in the rgisht way.

This here is the chart how it looks like:

http://img802.imageshack.us/img802/5306/lvu7.jpg

Can someone help me?

Accepted Solutions (0)

Answers (1)

Answers (1)

pavan_prabhu
Active Participant
0 Kudos

Hello Taly,

     Click on Image field in the layout. In the layout tab, the Expand to fit option of both Width and Height should be checked.

Former Member
0 Kudos

I found that what you told me... but it didn't worked

Florian
Active Contributor
0 Kudos

I think you have to recheck your imagefield which is exported.

Just download the export and check the size.

In the Adobe create an image field and set option to proportional is the option, you have to use.

The mistake must be done before exporting to adobe-stack.

Regards Florian

PS: Perhaps you can upload your image in original and I put it in a testform of me.

I got something for such things like that

Former Member
0 Kudos

Florian, i checked my program, and I wanted to download the image. And I did download it and now I found out that the problem is not in Adobe Forms, but I think the problem is when I convert it from the Chart to Image.

Here you see how the chart looks like:

http://img802.imageshack.us/img802/5306/lvu7.jpg

And Here is the downloaded Image after I take it from the chart:

http://img809.imageshack.us/img809/7977/dahx.png

To create the chart I used cl_gui_chart_engine. But to take the Image from the Chart I had to use cl_igs_chart_engine.

Cl_igs_Chart_Engine, for the SET_DATA and SET_CUSTOMIZING requires IF_IXML_DOCUMENT as parameters.

And I had to do a conversion from the variables that I used for Set_Data and Set_Customizing in CL_GUI_CHART_ENGINE (they were Strings).

Here is The code for the Conversions to IF_IXML_Document and to Get the Image:

PERFORM fill_igs USING g_layout f_custom.

  g_ce_igs->set_customizing(

  EXPORTING

  custom_doc = f_custom ).

  CLEAR data_xstr.

  PERFORM fill_igs USING g_text_data f_data.

  g_ce_igs->set_data( f_data ).

 

  g_ce_igs->execute( ).

DATA: img TYPE w3mimetabtype,

           img-s TYPE w3param-cont_len,

          img-t TYPE w3param-cont_type.

g_ce_igs->get_image(

  IMPORTING

  image = img " Image Content

  image_size = img-s " Screen Size

  image_type = img-t " Screen Type

  ).

FORM fill_igs USING g_str TYPE string

fo_document TYPE REF TO if_ixml_document.

  DATA: fs_raw255 TYPE solix.

  DATA: ft_raw255 TYPE solix_tab.

  DATA: f_tablenght TYPE i.

  DATA: f_string TYPE string.

  DATA: f_xstring TYPE xstring.

  DATA: fo_ixml TYPE REF TO if_ixml.

  DATA: fo_streamfactory TYPE REF TO if_ixml_stream_factory.

  DATA: fo_istream TYPE REF TO if_ixml_istream.

  DATA: fo_parser TYPE REF TO if_ixml_parser.

  DATA: f_ostream  TYPE REF TO if_ixml_ostream.

  DATA: xstr TYPE xstring.

  CALL FUNCTION 'SCMS_STRING_TO_XSTRING'

    EXPORTING

      text     = g_str

*     MIMETYPE = ' '

*     ENCODING = ENCODING

    IMPORTING

      buffer   = xstr

    EXCEPTIONS

      failed   = 1

      OTHERS   = 2.


  IF sy-subrc EQ 0.

    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'

      EXPORTING

        buffer          = xstr

*       APPEND_TO_TABLE = ' '

      IMPORTING

        output_length   = f_tablenght

      TABLES

        binary_tab      = ft_raw255.

  ENDIF.

  CHECK ft_raw255[] IS NOT INITIAL.

  fo_ixml = cl_ixml=>create( ).


  fo_streamfactory = fo_ixml->create_stream_factory( ).


  fo_document = fo_ixml->create_document( ).


  fo_istream = fo_streamfactory->create_istream_itable(

                                                                                         size = f_tablenght

                                                                                        table = ft_raw255 ).


  fo_parser = fo_ixml->create_parser( stream_factory = fo_streamfactory

                                                             istream      = fo_istream

                                                             document  = fo_document ).

  fo_parser->parse( ).


ENDFORM.



pavan_prabhu
Active Participant
0 Kudos

Hello Taly,

   

     To show the image correctly in the Adobe form, the image should be of type XSTRING.

So basically below steps you need to consider.

1) Convert the generated image into binary.

2) Then convert this binary content into XSTRING using Function Module "SCMS_BINARY_TO_XSTRING".

3) Use this XSTRING data into form by taking it into Graphic Node and then bind this node to the Image field in the layout.

4) Then you can use any of the 3 sizing options. Then the text in the image will not be overlapped or disturbed.

Florian
Active Contributor
0 Kudos

Hi Taly,

Pavan got exact the point. So you just do one step too much... ( I know,we all want the compiler doing some work)

That should be the solution for you. I that doesn't work I can share my sampleform with you.

Regards

Florian