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

To convert OTF to PDF using function module

Former Member
0 Likes
3,518

Hi !

Can some one help me by telling the name of the function module which can be used to convert OTF to PDF in UNICODE environment.

Thanks in advance

4 REPLIES 4
Read only

Former Member
0 Likes
1,010

Hi,

You can use the function module:

<b>CONVERT_OTF_2_PDF</b>

Vinod.

Read only

0 Likes
1,010

Hi Vinod,

I tried using that. But it is not working properly in UNICODE environment.

Read only

0 Likes
1,010

Hi,

U can try "SX_OBJECT_CONVERT_OTF_PDF" or "OTF_CONVERT".

Amit

Read only

0 Likes
1,010

Hi,

You can do this.

Use <b>'CONVERT_OTF'</b> FM to get the <b>Bin_filesize</b> like this:

data: i_lines TYPE tline OCCURS 0 WITH HEADER LINE.

data: ws_bin_size type i,

ws_filename type string.

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

format = 'PDF'

max_linewidth = 132

IMPORTING

bin_filesize = ws_bin_size

TABLES

otf = i_otf

lines = i_lines.

After this:

Get the download path for the file to be downloaded.

then:

  • Download

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

bin_filesize = ws_bin_size

filename = ws_filename

filetype = <b>'BIN'</b>

TABLES

data_tab = i_lines.

IF sy-subrc <> 0.

MESSAGE i050 WITH 'Error while File download'.

flg_exit = 'X'.

EXIT.

ELSE.

MESSAGE i050 WITH 'File downloaded successfully '.

flg_exit = 'X'.

EXIT.

ENDIF.

This works for unicode environment