on 2011 Aug 20 8:41 AM
Hi expert,
i want to save 1 PDF in server, i did it as below.
use otf function module to convert smartform into binary format,
then use open dataset , transfer data in internal table into pdf file in server.
all of these are working fine, but at last, when i am trying to open this PDF file, it gives an error, saying file is damaged. please help. thanks.
Hi
I use this code in a my program and it works fine:
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = bin_filesize
bin_file = pdf_bin
TABLES
otf = p_otf[]
lines = t_lines
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
IF sy-subrc <> 0.
............................
* PDF
pdf_content = cl_document_bcs=>xstring_to_solix( pdf_bin ).
IF bin_filesize > 0.
OPEN DATASET work_path_pdf FOR OUTPUT IN BINARY MODE.
IF sy-subrc <> 0.
cf_retcode = sy-subrc.
MESSAGE e208(00) WITH 'Errore in apertura file'(004) INTO l_message.
ENDIF.
CHECK cf_retcode = 0.
LOOP AT pdf_content INTO l_pdf.
TRANSFER l_pdf TO work_path_pdf.
ENDLOOP.
CLOSE DATASET work_path_pdf.
...............
It sould be similar to your code
Max
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Max!.
Emilio.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gurus!
Could you tell me how is your l_pdf defined?.
I mean data l_pdf like....
Thanks in advance.
Emilio.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.