2010년 5월 6일 목요일

CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'

http://forums.sdn.sap.com/thread.jspa?messageID=8457849#8457849


The CONTENT_BIN parameter is the binary PDF data.

I have something like the code below. The GS_JOB_OUTPUT_INFO-OTFDATA comes from the SmartForm function module.

DATA: ls_otf TYPE itcoo,
ls_pdf TYPE solisti1.

* convert OTF data to PDF
LOOP AT gs_job_output_info-otfdata INTO ls_otf.
CONCATENATE ls_otf-tdprintcom ls_otf-tdprintpar
INTO ls_pdf.
APPEND ls_pdf TO lt_content_txt.
ENDLOOP.
CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
EXPORTING
format_src = 'OTF'
format_dst = 'PDF'
CHANGING
transfer_bin = lv_transfer_bin
content_txt = lt_content_txt
content_bin = lt_content_bin
objhead = lt_objhead
len = lv_len
EXCEPTIONS
err_conv_failed = 1
OTHERS = 2.


=====================================================
Re: Convert Sapscript to PDF
Posted: Nov 16, 2005 4:24 AM in response to: Laura Portal Reply

Hi,

Are you sure that you used those things which I mentioned?

* Setting the options
w_options-tdcopies = 1 ."Number of copies
w_options-tdnoprev = c_x."No print preview
w_options-tdgetotf = c_x."Return of OTF table
w_options-tddest = c_locl."Spool: Output device

* Opening the form
CALL FUNCTION 'OPEN_FORM'
EXPORTING
form = c_form
device = c_printer
language = sy-langu
OPTIONS = w_options
IMPORTING
RESULT = w_res.

=====================================================

Re: Convert Sapscript to PDF
Posted: Nov 15, 2005 1:04 PM in response to: Laura Portal Reply

Have a look at these FM also

CONVERT_OTFSPOOLJOB_2_PDF ==== converts a OTF spool to PDF (i.e. Sapscript document)
SX_OBJECT_CONVERT_OTF_PDF ==== Conversion From OTF to PDF (SAPScript conversion)

댓글 없음: