Skip to Content
0
Former Member
Dec 11, 2013 at 04:38 PM

convert text format and japanese/chinese signs from ITF to PDF

81 Views

Hi all,

as a cookbook I convert the ITF-format to OTF and then to PDF as seen below:


CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = iv_smartform_name
IMPORTING
fm_name = lv_function_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.

IF lv_function_name IS INITIAL.
RETURN.
ENDIF.

ls_control_parameters-no_open = ' '. "SAP SF: General flag
ls_control_parameters-no_close = ' '. "SAP SF: General flag
ls_control_parameters-device = 'PRINTER'. "Output device

ls_control_parameters-no_dialog = 'X'. "suppress printer dialog
ls_control_parameters-preview = ' '. "Print preview
ls_control_parameters-getotf = 'X'. "Return OTF tab, no print
ls_output_options-tddest = 'LOCL'. "local printer
ls_output_options-tdnoprev = 'X'.

TRY .

" in this example lv_function_name = /1BCDWB/SF00000006
CALL FUNCTION lv_function_name
EXPORTING
iv_header_guid = lv_header_guid
control_parameters = ls_control_parameters
output_options = ls_output_options
user_settings = 'X'
IMPORTING
job_output_info = ls_job_output_info
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.

CATCH cx_sy_message_in_plugin_mode.
sy-subrc = 0.
ENDTRY.

* convert OTF output to PDF
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = lv_filesize
bin_file = lv_xstring
TABLES
otf = ls_job_output_info-otfdata
lines = ls_rawline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5. "#EC TRANSLANG

IF sy-subrc <> 0.
RETURN.
ENDIF.

ev_xstring = lv_xstring. " GET_EMAIL_TEXT



It is only running for normal ASCII-code.

All formatted commands in ITF like <I>, <B> or <U> are displayed in PDF as <I>, <B> or <U> without converting. In OTF data I can see
<I>, <B> or <U> and I don't know if this is ok or not. In my view, the format commands should be converted in OTF.

Japanese signs like "ダイレクト" are looking good in OTF data, but in PDF it looks like "À¤ì¯È". OutputDevice of my user is set to LOCL_JPSAPWIN and the attribute %RESULT_OP-TDPRINTER in /1BCDWB/SF00000006 is set to JPSAPWIN.

Can anybody tell me what I am doing wrong?

Thanks

Jens