cancel
Showing results for 
Search instead for 
Did you mean: 

Issue while converting OTF to PDF for arabic text.

Former Member
0 Kudos

Hi all,

I have craeted the smartform and coverted the otf to PDF . Find below code.

For English PDF is comming propely , but arabic text is showing some junk .

when i execute smartform alone in arabic it comes propely but PDF is not comming correctly.

   CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
      formname           = gv_form
    IMPORTING
      fm_name            = lv_fmname
    EXCEPTIONS
      no_form            = 1
      no_function_module = 2
      OTHERS             = 3.
  IF sy-subrc EQ 0.
    CLEAR: ls_control_parameters.
    CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
      EXPORTING
        i_language    = '*' "'E'
        i_application = 'SAPDEFAULT'
      IMPORTING
        e_devtype     = lv_e_devtype.
    ls_output_options-tdprinter     = lv_e_devtype.
    ls_control_parameters-no_dialog = abap_true.
    ls_control_parameters-getotf    = abap_true.
    ls_control_parameters-LANGU   = gv_langu.

    CLEAR: gs_zhr_terhous, ls_job_output_info.
    LOOP AT gt_zhr_terhous INTO gs_zhr_terhous.
      CALL FUNCTION lv_fmname
        EXPORTING
          control_parameters = ls_control_parameters
          output_options     = ls_output_options
          im_params          = gs_zhr_terhous
        IMPORTING
          job_output_info    = ls_job_output_info
        EXCEPTIONS
          formatting_error   = 1
          internal_error     = 2
          send_error         = 3
          user_canceled      = 4
          OTHERS             = 5.

      IF sy-subrc EQ 0.
        IF ls_job_output_info-otfdata IS NOT INITIAL.
          APPEND LINES OF ls_job_output_info-otfdata TO gt_otfdata.
        ENDIF.
      ENDIF.
    ENDLOOP.
  ENDIF.

*Display PDF
IF gt_otfdata[] IS NOT INITIAL.
    CALL FUNCTION 'HR_IT_DISPLAY_WITH_PDF'
      TABLES
        otf_table = gt_otfdata.
  ENDIF.

For English PDF is comming propely , but arabic text is showing some junk .

Thanks,

Deepa

Accepted Solutions (0)

Answers (2)

Answers (2)

aidan_black
Active Contributor
0 Kudos

Hi,

I see above that you have the settings

ls_output_options-tdprinter     = lv_e_devtype.
ls_control_parameters-LANGU   = gv_langu.

Parameter should be filled with 'ARSWIN'. Parameter ls_control_parameters-LANGU should be filled with 'AR'. Can you try with these settings and check the result?

I am not familiar with function module 'HR_IT_DISPLAY_WITH_PDF'. Another possibility to convert the OTF to PDF is function module CONVERT_OTF. Sample program BCS_EXAMPLE_8( see SAP note 1324547) shows how CONVERT_OTF should be called and how to handle the returned PDF data.

regards,

Aidan

eduardo_hinojosa
Active Contributor
0 Kudos

Hi

Check these notes

Note 587150 - Support of Arabic-script languages

Note 488810 - D etermining the device type for a certain language

Note 776507 - SAPscript/SmartForms: Which fonts for which languages?

I hope this helps you

Regards

Eduardo