ABAP 拼接PDF
2024-10-21 03:15:03
参考标准程序RSPO_TEST_MERGE_PDF_FILES
*--合并PDF
data: pdf_merger type ref to cl_rspo_pdf_merge.
data: ex type ref to cx_rspo_pdf_merge, lv_ex_txt type string.
data: rc type i value 0. data: docindex type i value 0, errordoc type xstring.
try.
create object pdf_merger.
catch cx_rspo_pdf_merge into ex.
lv_ex_txt = ex->get_text( ).
write: / lv_ex_txt color col_negative.
rc = 1.
return.
endtry.
PDF_MERGER->ADD_DOCUMENT( 文件流 ).
PDF_MERGER->ADD_DOCUMENT( 文件流 ).
PDF_MERGER->MERGE_DOCUMENTS( IMPORTING MERGED_DOCUMENT = MERGED_DOCUMENT RC = RC ).
IF RC <> 0.
PDF_MERGER->GET_ERR_DOC_INDEX( IMPORTING INDEX = DOCINDEX ).
PDF_MERGER->GET_DOCUMENT( EXPORTING INDEX = DOCINDEX IMPORTING DOCUMENT = ERRORDOC ).
ENDIF. CLEAR PDF_MERGER.
*--下载PDF
perform put_merged_file using merged_document.
form put_merged_file using merged_document type xstring. data: bin_tab type standard table of tabl1024.
data: lo_gui type ref to cl_gui_frontend_services.
data: path type string, fullpath type string.
data: length type i.
data: filter type string, uact type i, name type string.
DATA:cmd(2000) type c. create object lo_gui. call function 'SCMS_XSTRING_TO_BINARY'
exporting
buffer = merged_document
importing
output_length = length
tables
binary_tab = bin_tab. call method lo_gui->file_save_dialog
exporting
default_extension = 'pdf'
default_file_name = 'merged.pdf'
file_filter = filter
changing
filename = name
path = path
fullpath = fullpath
user_action = uact.
if uact = lo_gui->action_cancel.
exit.
endif.
lo_gui->gui_download( exporting
filename = fullpath
filetype = 'BIN'
bin_filesize = length
changing
data_tab = bin_tab ).
SPAN { font-family: "Courier New"; font-size: 10pt; color: rgba(0, 0, 0, 1); background: rgba(255, 255, 255, 1) }
.L0S31 { font-style: italic; color: rgba(128, 128, 128, 1) }
.L0S52 { color: rgba(0, 0, 255, 1) }
.L0S55 { color: rgba(128, 0, 128, 1) }
最新文章
- LeetCode---Binary Search
- Python: 无参数的函数装饰器
- 最完整的合并相交集合的Java代码(查并集)
- linq的一些用法总结
- 基于Mesos运行Spark
- contentHorizontalAlignment 属性浅析
- sublime text2的插件熟悉
- NemaStudio船舶模拟软件下载及破解
- WC2016自测
- OAF开发概念和案例总结(项目总结)
- linux 按行分割文件
- js 解析url
- Finance财务软件(引入业务系统凭证专题)
- 滑雪(dp)
- 性能监控扩展篇(grafana + influxdb + telegraf)
- 01 Linux简介
- java非常好用的读取文件的流的代码
- Scrapy-从数据库取出IP并判断是否可用
- struts配置中的常量定义
- 【CodeForces】870 F. Paths