Skip to Content
0
Former Member
Dec 02, 2011 at 03:29 PM

CONVERT_OTF error while opening the file in acrobat professional.

215 Views

Hi Gurus,

I'm using 'CONVERT_OTF' to convert smartform to PDF and then I'm saving the file to application server (Code shown below). ADOBE Acrobat Viewer can handle this error when you open the PDF file - you don't get an error message.

Adobe Acrobat Professional can also open the corrupted file but you'll get the following message if you close it:

'Do you want to save changes to file before closing?'

Kindly help me why some files can be processed successfully and some files gets corrupted.

call function 'CONVERT_OTF'

exporting

format = 'PDF'

max_linewidth = 132

importing

bin_filesize = v_len_in

  • BIN_FILE = LD_BINFILE

tables

otf = i_otf

lines = i_tline

exceptions

err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3

others = 4.

if sy-subrc <> 0.

perform protocol_update.

endif.

loop at i_tline.

translate i_tline using '~'.

concatenate wa_buffer i_tline into wa_buffer.

endloop.

translate wa_buffer using '~'.

do.

i_objbin = wa_buffer.

append i_objbin.

shift wa_buffer left by 255 places.

if wa_buffer is initial.

exit.

endif.

enddo.

open dataset v_unix for output in binary mode

message v_message.

if sy-subrc ne 0.

message 'Could not open file for saving' type 'E'.

endif.

loop at i_objbin.

transfer i_objbin to v_unix.

endloop.

close dataset v_unix.