Skip to Content
0

image is get corrupt see my code where i am send content PDF as in string format

Oct 07, 2017 at 05:42 AM

81

avatar image
Former Member

SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L0S31 { font-style: italic; color: #808080; } .L0S32 { color: #3399FF; } .L0S33 { color: #4DA619; } .L0S52 { color: #0000FF; } .L0S55 { color: #800080; } .L0S70 { color: #808080; }

CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = lv_bin_filesize
bin_file = lv_BIN_FILE
TABLES
otf = lt_otf
lines = lt_pdf_tab
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

data : lt_tab TYPE TABLE OF string .

data : lv_lent TYPE i .

data: loc_conv type ref to CL_ABAP_CONV_IN_CE,
loc_xstring type xstring,
loc_string type string.
CALL METHOD CL_ABAP_CONV_IN_CE=>CREATE
EXPORTING
INPUT = lv_BIN_FILE
ENCODING = 'UTF-8'
REPLACEMENT = '?'
IGNORE_CERR = ABAP_TRUE
RECEIVING
CONV = loc_CONV.

TRY.
CALL METHOD loc_CONV->READ
IMPORTING
DATA = loc_string.
CATCH CX_SY_CONVERSION_CODEPAGE.
*-- Should ignore errors in code conversions
CATCH CX_SY_CODEPAGE_CONVERTER_INIT.
*-- Should ignore errors in code conversions
CATCH CX_PARAMETER_INVALID_TYPE.
CATCH CX_PARAMETER_INVALID_RANGE.
ENDTRY.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers