CRM UI 打印PDF
这是项目上看到的绝技^_^
1.画SF。这步就不说了
2.确定参数,写SF打印PDF函数
FUNCTION zsrv_print_to_pdf .
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IV_SAMRTFORM) TYPE TDSFNAME
*" REFERENCE(IV_GUID) TYPE CRMT_OBJECT_GUID OPTIONAL
*" REFERENCE(IV_OBJECT_ID) TYPE CRMT_OBJECT_ID OPTIONAL
*" REFERENCE(IV_ZSERIALNO) TYPE ZSERIALNO OPTIONAL
*" EXPORTING
*" REFERENCE(FILE) TYPE XSTRING
*"----------------------------------------------------------------------
DATA: lv_fmodule TYPE rs38l_fnam,
lv_formfm TYPE rs38l_fnam,
lt_data_exchange TYPE TABLE OF zreq_chg,
lt_data_refund TYPE TABLE OF zreq_chg,
lt_data_dispatch TYPE TABLE OF zcrm_csr_order,
lt_data_service TYPE TABLE OF zsv_ord,
lt_text TYPE comt_text_lines_t,
lv_tablename TYPE string,
lv_exit_check TYPE flag,
lv_reason TYPE string.
DATA:
lv_langu TYPE sy-langu,
w_cparam TYPE ssfctrlop,
w_outoptions TYPE ssfcompop,
w_bin_filesize TYPE i, " Binary File Size
w_bin_file TYPE xstring.
DATA:GV_ZNUMBER TYPE ZNUMBER.
DATA:GW_ZHSI_REFURBISH TYPE ZHSI_REFURBISH.
DATA: t_otf TYPE TABLE OF itcoo,
* Internal table to hold OTF data recd from the SMARTFORM
t_otf_from_fm TYPE ssfcrescl,
* Internal table to hold the data from the FM CONVERT_OTF
t_pdf_tab TYPE TABLE OF tline.. FIELD-SYMBOLS <fs_data> TYPE table. IF iv_samrtform IS INITIAL.
RETURN.
ENDIF. CASE iv_samrtform.
WHEN 'ZEXCH'.
lv_fmodule = 'ZGET_EXCHANGE_REQUEST_DATA'.
WHEN 'ZREFUND'.
lv_fmodule = 'ZGET_REFUND_REQUEST_DATA'.
WHEN 'Z_DISPATCH'.
lv_fmodule = 'ZGET_CSR_DISPATCH_ORDER_DATA'.
WHEN 'ZSERVICE_ORD' OR 'ZSERVICE_ORD_AU' OR 'ZSERVICE_ORD_ZA'.
lv_fmodule = 'ZGET_SERVICE_ORDER_DATA'.
WHEN 'ZSRV_ORD' OR 'ZSRV_ORD_N' OR 'ZSRV_ORD_ZA'.
lv_fmodule = 'ZGET_SERVICE_ORDER_DATA'.
WHEN 'ZREPAIR_REP01'.
lv_exit_check = 'X'.
WHEN 'ZCRM_SERVICE_01'.
lv_exit_check = 'X'.
WHEN 'ZCRM_SERVICE_02'.
lv_exit_check = 'X'.
ENDCASE. IF lv_exit_check IS INITIAL.
CALL FUNCTION 'FUNCTION_EXISTS'
EXPORTING
funcname = lv_fmodule
EXCEPTIONS
function_not_exist =
OTHERS = .
IF sy-subrc <> .
RETURN.
ENDIF.
ENDIF. CASE iv_samrtform.
WHEN 'ZEXCH'.
CALL FUNCTION lv_fmodule
EXPORTING
iv_guid = iv_guid
iv_object_id = iv_object_id
IMPORTING
reasons = lv_reason
TABLES
data = lt_data_exchange. WHEN 'ZREFUND'.
CALL FUNCTION lv_fmodule
EXPORTING
iv_guid = iv_guid
iv_object_id = iv_object_id
IMPORTING
reasons = lv_reason
TABLES
data = lt_data_refund. WHEN 'Z_DISPATCH'.
CALL FUNCTION lv_fmodule
EXPORTING
iv_guid = iv_guid
iv_object_id = iv_object_id
TABLES
data = lt_data_dispatch. WHEN 'ZSERVICE_ORD' OR 'ZSERVICE_ORD_AU' OR 'ZSERVICE_ORD_ZA'.
CALL FUNCTION lv_fmodule
EXPORTING
iv_guid = iv_guid
iv_object_id = iv_object_id
TABLES
data = lt_data_service. WHEN 'ZSRV_ORD' OR 'ZSRV_ORD_N' OR 'ZSRV_ORD_ZA'.
CALL FUNCTION lv_fmodule
EXPORTING
iv_guid = iv_guid
iv_object_id = iv_object_id
TABLES
data = lt_data_service. ENDCASE. CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = iv_samrtform
IMPORTING
fm_name = lv_formfm
EXCEPTIONS
no_form =
no_function_module =
OTHERS = .
IF sy-subrc <> .
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. * Calling the SMARTFORM using the function module retrieved above
* GET_OTF parameter in the CONTROL_PARAMETERS is set to get the OTF
* format of the output
w_cparam-no_dialog = 'X'.
w_cparam-preview = space. " Suppressing the dialog box w_cparam-getotf = 'X'. " for print preview ****---add by alex_zhang on 20160901
* w_cparam-no_open = 'X'.
* w_cparam-no_close = 'X'. * Printer name to be used is provided in the export parameter
* OUTPUT_OPTIONS
w_outoptions-tddest = 'LP01'. **********************************************************************20161117-Begin
*开发顾问:陈国光
*业务顾问:龚慧文
*打印中文乱码该方案仅针对UI按钮打印 未能从根本解决问题 故先取消
* IF zcl_crm_attributes=>gv_zcrm_print = abap_true.
* w_cparam-langu = '1'.
* zcl_crm_attributes=>gv_zcrm_print = abap_false.
* ENDIF.
**********************************************************************20161117-End
CASE iv_samrtform.
WHEN 'ZEXCH'.
CALL FUNCTION lv_formfm
EXPORTING
control_parameters = w_cparam
output_options = w_outoptions
reasons = lv_reason
IMPORTING
job_output_info = t_otf_from_fm
TABLES
datasets = lt_data_exchange
EXCEPTIONS
formatting_error =
internal_error =
send_error =
user_canceled =
OTHERS = .
IF sy-subrc <> .
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. WHEN 'ZREFUND'.
CALL FUNCTION lv_formfm
EXPORTING
control_parameters = w_cparam
output_options = w_outoptions
reasons = lv_reason
IMPORTING
job_output_info = t_otf_from_fm
TABLES
datasets = lt_data_refund
EXCEPTIONS
formatting_error =
internal_error =
send_error =
user_canceled =
OTHERS = .
IF sy-subrc <> .
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. WHEN 'Z_DISPATCH'.
CALL FUNCTION lv_formfm
EXPORTING
control_parameters = w_cparam
output_options = w_outoptions
IMPORTING
job_output_info = t_otf_from_fm
TABLES
zorder = lt_data_dispatch
EXCEPTIONS
formatting_error =
internal_error =
send_error =
user_canceled =
OTHERS = .
IF sy-subrc <> .
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. WHEN 'ZSERVICE_ORD' OR 'ZSERVICE_ORD_AU' OR 'ZSERVICE_ORD_ZA'.
CALL FUNCTION lv_formfm
EXPORTING
control_parameters = w_cparam
output_options = w_outoptions
IMPORTING
job_output_info = t_otf_from_fm
TABLES
datasets = lt_data_service
EXCEPTIONS
formatting_error =
internal_error =
send_error =
user_canceled =
OTHERS = .
IF sy-subrc <> .
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. WHEN 'ZSRV_ORD' OR 'ZSRV_ORD_N' OR 'ZSRV_ORD_ZA'.
CALL FUNCTION lv_formfm
EXPORTING
control_parameters = w_cparam
output_options = w_outoptions
IMPORTING
job_output_info = t_otf_from_fm
TABLES
datasets = lt_data_service
EXCEPTIONS
formatting_error =
internal_error =
send_error =
user_canceled =
OTHERS = .
IF sy-subrc <> .
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. WHEN 'ZREPAIR_REP01'.
CALL FUNCTION lv_formfm
EXPORTING
control_parameters = w_cparam
output_options = w_outoptions
object_id = iv_object_id
IMPORTING
job_output_info = t_otf_from_fm
EXCEPTIONS
formatting_error =
internal_error =
send_error =
user_canceled =
OTHERS = .
IF sy-subrc <> .
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
WHEN 'ZCRM_SERVICE_01'."ADD BY LY 20170217 FOR 维修跟踪单打印
CALL FUNCTION lv_formfm
EXPORTING
control_parameters = w_cparam
output_options = w_outoptions
object_id = iv_object_id
IMPORTING
job_output_info = t_otf_from_fm
EXCEPTIONS
formatting_error =
internal_error =
send_error =
user_canceled =
OTHERS = .
IF sy-subrc <> .
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. WHEN 'ZCRM_SERVICE_02'."ADD BY LY 20170217 FOR 周转机检查单打印
"生成不良品再生单单号
PERFORM prm_generate_obj CHANGING GV_ZNUMBER. CALL FUNCTION lv_formfm
EXPORTING
control_parameters = w_cparam
output_options = w_outoptions
ZSERIALNO = iv_ZSERIALNO
ZNUMBER = GV_ZNUMBER
IMPORTING
job_output_info = t_otf_from_fm
EXCEPTIONS
formatting_error =
internal_error =
send_error =
user_canceled =
OTHERS = .
IF sy-subrc <> .
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. SELECT SINGLE ZSERIALNO
ZPRODUCT_ID
ZCMODENO
ZSTORE_LOC
INTO (GW_ZHSI_REFURBISH-ZCSERIALNO,GW_ZHSI_REFURBISH-ZMODENO,
GW_ZHSI_REFURBISH-ZCMODENO,GW_ZHSI_REFURBISH-ZLGORT)
FROM ZSRVT_JA_001 WHERE ZSERIALNO = iv_ZSERIALNO.
GW_ZHSI_REFURBISH-ZNUMBER = GV_ZNUMBER.
GW_ZHSI_REFURBISH-ZBATCHNO = 'H'.
GW_ZHSI_REFURBISH-ZRFSTATUS = ''.
GW_ZHSI_REFURBISH-ZCOUNTRY = 'JP'.
GW_ZHSI_REFURBISH-ZSALES_ORG = 'O 50000231'.
GW_ZHSI_REFURBISH-ZWERKS = ''.
GW_ZHSI_REFURBISH-CREATED_BY = SY-UNAME.
CONVERT DATE SY-DATUM TIME SY-UZEIT INTO TIME STAMP
GW_ZHSI_REFURBISH-CREATED_AT TIME ZONE SY-ZONLO. MODIFY ZHSI_REFURBISH FROM GW_ZHSI_REFURBISH. ENDCASE. t_otf[] = t_otf_from_fm-otfdata[]. CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth =
IMPORTING
bin_filesize = w_bin_filesize
bin_file = w_bin_file
TABLES
otf = t_otf
lines = t_pdf_tab
EXCEPTIONS
err_max_linewidth =
err_format =
err_conv_not_possible =
err_bad_otf =
OTHERS = .
IF sy-subrc <> .
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
MOVE w_bin_file TO file.
ENDFUNCTION.
3.将输出的PDF文件流用PDF展示:
创建ZCRM_PRINT WDA程序
Window中MODIFY window
METHOD wddomodifyview .
* variable declarations
DATA:
w_form_name TYPE tdsfname,
w_fmodule TYPE rs38l_fnam,
w_cparam TYPE ssfctrlop,
w_outoptions TYPE ssfcompop,
w_bin_filesize TYPE i, " Binary File Size
w_bin_file TYPE xstring,
w_filename TYPE string,
w_file_path TYPE string,
w_full_path TYPE string. DATA lo_nd_order TYPE REF TO if_wd_context_node.
DATA lo_el_order TYPE REF TO if_wd_context_element.
DATA ls_order TYPE wd_this->element_order.
DATA lo_nd_pdf TYPE REF TO if_wd_context_node.
DATA lo_el_pdf TYPE REF TO if_wd_context_element.
DATA ls_pdf TYPE wd_this->element_pdf.
DATA lv_source TYPE wd_this->element_pdf-source. lo_nd_order = wd_context->get_child_node( name = wd_this->wdctx_order ).
lo_el_order = lo_nd_order->get_element( ).
lo_el_order->get_static_attributes( IMPORTING static_attributes = ls_order ). zcl_crm_attributes=>gv_zcrm_print = abap_true. CALL FUNCTION 'ZSRV_PRINT_TO_PDF'
EXPORTING
iv_samrtform = ls_order-smartform_name "'ZREFUND'
iv_object_id = ls_order-object_id "'0074000104'
IV_ZSERIALNO = ls_order-ZSERIALNO "'0074000104'
IMPORTING
file = w_bin_file. CHECK w_bin_file IS NOT INITIAL. lo_nd_pdf = wd_context->get_child_node( name = wd_this->wdctx_pdf ).
lo_el_pdf = lo_nd_pdf->get_element( ).
lv_source = w_bin_file.
lo_el_pdf->set_attribute( name = `SOURCE` value = lv_source ).
ENDMETHOD.
4.window传入参数:
METHOD handledefault .
DATA lo_nd_order TYPE REF TO if_wd_context_node. DATA lo_el_order TYPE REF TO if_wd_context_element.
DATA ls_order TYPE wd_this->element_order. lo_nd_order = wd_context->get_child_node( name = wd_this->wdctx_order ).
lo_el_order = lo_nd_order->get_element( ).
lo_el_order->get_static_attributes( IMPORTING static_attributes = ls_order ). ls_order-object_id = object_id.
ls_order-smartform_name = smartform_name.
ls_order-ZSERIALNO = ZSERIALNO."ADD BY LY 20170220 lo_el_order->set_static_attributes( static_attributes = ls_order ).
ENDMETHOD.
5.最后将WINDOW做成接口视图
6.UI调用
GET_BUTTONS/DO_PREPARE_OUTPUT
METHOD IF_BSP_WD_TOOLBAR_CALLBACK~GET_BUTTONS.
DATA: LS_BUTTON TYPE CRMT_THTMLB_BUTTON_EXT.
DATA: LV_URL TYPE STRING,
LV_URL2 TYPE STRING,
LV_OBJECT_ID TYPE CRMT_OBJECT_ID,
LV_SRV_TYPE TYPE ZDTEL00003Y,
LV_SMARTFORM_NAME TYPE TDSFNAME. DATA: LR_ENTITY TYPE REF TO CL_CRM_BOL_ENTITY,
LR_COLL TYPE REF TO IF_BOL_ENTITY_COL,
LR_CURRENT TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS,
LR_ENTITY_ORG TYPE REF TO CL_CRM_BOL_ENTITY,
LV_PROCESS_TYPE TYPE STRING,
LS_ORGSET_BTIL TYPE CRMST_ORGSET_BTIL. FIELD-SYMBOLS: <FS_OBJECT_ID> TYPE CRMT_OBJECT_ID. CALL METHOD SUPER->IF_BSP_WD_TOOLBAR_CALLBACK~GET_BUTTONS
RECEIVING
RT_BUTTONS = RT_BUTTONS. DELETE RT_BUTTONS WHERE ON_CLICK = 'OUTPUT'.
DELETE RT_BUTTONS WHERE ON_CLICK = 'PRINT_PREVIEW'. LR_ENTITY ?= ME->ZTYPED_CONTEXT->BTADMINH->COLLECTION_WRAPPER->GET_CURRENT( ).
IF LR_ENTITY IS BOUND.
TRY.
LV_PROCESS_TYPE = LR_ENTITY->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'PROCESS_TYPE').
CALL METHOD LR_ENTITY->IF_BOL_BO_PROPERTY_ACCESS~GET_PROPERTY_AS_VALUE
EXPORTING
IV_ATTR_NAME = 'OBJECT_ID'
IMPORTING
EV_RESULT = LV_OBJECT_ID.
LR_COLL = LR_ENTITY->GET_RELATED_ENTITIES( IV_RELATION_NAME = 'BTHeaderOrgmanSet' ). "
LR_CURRENT = LR_COLL->GET_CURRENT( ).
IF LR_CURRENT IS BOUND.
LR_ENTITY_ORG ?= LR_CURRENT.
LR_ENTITY_ORG->IF_BOL_BO_PROPERTY_ACCESS~GET_PROPERTIES( IMPORTING ES_ATTRIBUTES = LS_ORGSET_BTIL ).
ENDIF.
CATCH CX_CRM_CIC_PARAMETER_ERROR.
ENDTRY.
ENDIF. CHECK LV_OBJECT_ID IS NOT INITIAL. CHECK LV_PROCESS_TYPE = 'ZSR2' OR LV_PROCESS_TYPE = 'ZSR3' OR LV_PROCESS_TYPE = 'ZSV1' OR LV_PROCESS_TYPE = 'ZSV2' OR LV_PROCESS_TYPE = 'ZSV3' OR LV_PROCESS_TYPE = 'ZWO4'. CASE LV_PROCESS_TYPE.
WHEN 'ZSR2'.
LV_SMARTFORM_NAME = 'ZEXCH'.
CONCATENATE 'javascript:window.open( "/sap/bc/webdynpro/sap/ZCRM_PRINT' '?object_id=' LV_OBJECT_ID '&smartform_name=' LV_SMARTFORM_NAME '");' INTO LV_URL. WHEN 'ZSR3'.
LV_SMARTFORM_NAME = 'ZREFUND'.
CONCATENATE 'javascript:window.open( "/sap/bc/webdynpro/sap/ZCRM_PRINT' '?object_id=' LV_OBJECT_ID '&smartform_name=' LV_SMARTFORM_NAME '");' INTO LV_URL. WHEN 'ZSV1'.
IF LS_ORGSET_BTIL-SALES_ORG = 'O 50000178'.
LV_SMARTFORM_NAME = 'ZSRV_ORD'.
ELSEIF LS_ORGSET_BTIL-SALES_ORG = 'O 50000192' OR LS_ORGSET_BTIL-SALES_ORG = 'O 50000194'.
LV_SMARTFORM_NAME = 'ZSRV_ORD_ZA'.
ELSE.
LV_SMARTFORM_NAME = 'ZSRV_ORD_N'.
ENDIF.
CONCATENATE 'javascript:window.open( "/sap/bc/webdynpro/sap/ZCRM_PRINT' '?object_id=' LV_OBJECT_ID '&smartform_name=' LV_SMARTFORM_NAME '");' INTO LV_URL. WHEN 'ZSV2'.
IF LS_ORGSET_BTIL-SALES_ORG = 'O 50000192' OR LS_ORGSET_BTIL-SALES_ORG = 'O 50000194'.
LV_SMARTFORM_NAME = 'ZSERVICE_ORD_ZA'.
ELSE.
LV_SMARTFORM_NAME = 'ZSERVICE_ORD'.
ENDIF.
CONCATENATE 'javascript:window.open( "/sap/bc/webdynpro/sap/ZCRM_PRINT' '?object_id=' LV_OBJECT_ID '&smartform_name=' LV_SMARTFORM_NAME '");' INTO LV_URL. WHEN 'ZSV3'.
IF LS_ORGSET_BTIL-SALES_ORG = 'O 50000131'.
LV_SMARTFORM_NAME = 'ZSERVICE_ORD_AU'.
ELSEIF LS_ORGSET_BTIL-SALES_ORG = 'O 50000192' OR LS_ORGSET_BTIL-SALES_ORG = 'O 50000194'.
LV_SMARTFORM_NAME = 'ZSERVICE_ORD_ZA'.
ELSE.
LV_SMARTFORM_NAME = 'ZSERVICE_ORD'.
ENDIF.
CONCATENATE 'javascript:window.open( "/sap/bc/webdynpro/sap/ZCRM_PRINT' '?object_id=' LV_OBJECT_ID '&smartform_name=' LV_SMARTFORM_NAME '");' INTO LV_URL. WHEN 'ZWO4'.
LV_SMARTFORM_NAME = 'ZSERVICE_ORD'.
CONCATENATE 'javascript:window.open( "/sap/bc/webdynpro/sap/ZCRM_PRINT' '?object_id=' LV_OBJECT_ID '&smartform_name=' LV_SMARTFORM_NAME '");' INTO LV_URL. WHEN OTHERS.
ENDCASE.
CLEAR LS_BUTTON.
LS_BUTTON-TEXT = CL_WD_UTILITIES=>GET_OTR_TEXT_BY_ALIAS( 'ZCRM/PDFPRINT' ). "#EC NOTEXT
LS_BUTTON-ON_CLIENT_CLICK = LV_URL.
LS_BUTTON-ENABLED = ABAP_TRUE. "#EC NOTEXT
INSERT LS_BUTTON INTO RT_BUTTONS INDEX . CALL METHOD LR_ENTITY->IF_BOL_BO_PROPERTY_ACCESS~GET_PROPERTY_AS_VALUE
EXPORTING
IV_ATTR_NAME = 'ZZFLD00000N'
IMPORTING
EV_RESULT = LV_SRV_TYPE. CLEAR:LV_URL,LS_BUTTON.
LV_SMARTFORM_NAME = 'ZREPAIR_REP01'.
CONCATENATE 'javascript:window.open( "/sap/bc/webdynpro/sap/ZCRM_PRINT' '?object_id=' LV_OBJECT_ID '&smartform_name=' LV_SMARTFORM_NAME '");' INTO LV_URL.
LS_BUTTON-TEXT = 'Repair Rep Print'. "#EC NOTEXT
LS_BUTTON-ON_CLIENT_CLICK = LV_URL.
LS_BUTTON-ENABLED = ABAP_TRUE. "#EC NOTEXT
INSERT LS_BUTTON INTO RT_BUTTONS INDEX . IF LV_PROCESS_TYPE = 'ZSV1'.
CLEAR:LV_URL,LS_BUTTON.
LV_SMARTFORM_NAME = 'ZCRM_SERVICE_01'.
CONCATENATE 'javascript:window.open( "/sap/bc/webdynpro/sap/ZCRM_PRINT' '?object_id=' LV_OBJECT_ID '&smartform_name=' LV_SMARTFORM_NAME '");' INTO LV_URL.
LS_BUTTON-TEXT = 'Repair Follow Print'. "#EC NOTEXT
LS_BUTTON-ON_CLIENT_CLICK = LV_URL.
LS_BUTTON-ENABLED = ABAP_TRUE. "#EC NOTEXT
INSERT LS_BUTTON INTO RT_BUTTONS INDEX .
ENDIF. ENDMETHOD.
CRM UI 打印PDF的更多相关文章
- C# 打印PDF文件之使用不同打印机打印所有页面或部分页面
C# 打印PDF文件之使用不同打印机打印所有页面或部分页面 最近在逛国外各大编程社区论坛的时候,发现很多人都在问一个关于PDF文件打印的问题:打印时如何选择非默认打印机并设置打印页面的范围.而一般情况 ...
- Winform 打印PDF顺序混乱,获取打印队列
工作中PDF打印顺序混乱着实让我疼痛了好久,其实决绝方法非常简单,但没有想到这个点子的时候确实让我走了很多弯路 这里文章写出来并不是为了炫耀什么,只是觉得发现些好东西就分享出来而已,同时也做个记录,方 ...
- 关于这两天研究Java打印pdf方法的记录
这两天在研究Java调用打印机打印PDF文件的方法,学到了不少东西,特别来记录一下. 关于Java打印网上最多的而且也是Java正统的打印方法就是使用PrintService,一套比較标准的打印代码例 ...
- PDFBox创建并打印PDF文件, 以及缩放问题的处理.
PDFBox带了一些很方便的API, 可以直接创建 读取 编辑 打印PDF文件. 创建PDF文件 public static byte[] createHelloPDF() { ByteArrayOu ...
- C#调用Python脚本打印pdf文件
介绍:通过pdf地址先将文件下载到本地,然后调用打印机打印,最后将下载的文件删除. 环境:windows系统.(windows64位) windows系统中安装python3.6.2环境 资料: O ...
- C# 打印PDF文档的10种方法
操作PDF文档时,打印是常见的需求之一.针对不同的打印需求,可分多种情况来进行,如设置静默打印.指定打印页码范围和打印纸张大小.双面打印.黑白打印等等.经过测试,下面将对常见的几种PDF打印需求做一些 ...
- C#使用iTextSharp+ZXing.Net+FreeSpire.PDF生成和打印pdf文档
项目需求(Winform)可以批量打印某个模板,经过百度和摸索,使用iTextSharp+ZXing.Net+FreeSpire.PDF三个类库实现了生成pdf.生成条形码和打印pdf功能. 首先在项 ...
- 安卓打印实现打印pdf文档
先声明一下,此处的打印非pos打印机打印和蓝牙打印机打印,如果想查找打印小票的pos打印机请进入下面的传送门,蓝牙打印目前没做过,有做过的请指教. pos打印机传送门: 1. https://www. ...
- Chrome 打印PDF技巧
Chrome 打印PDF技巧 原文地址:https://github.com/zhongxia245/blog/issues/22 欢迎star 本教程,使用Mac电脑进行演示. 常规的Chrome打 ...
随机推荐
- FI CO 常用表
FI CO 常用表 最近写FICO的报表写得有点多,许多Table记不住,用F1查找又有点费事,不如把表单写下来,以后用到,直接在这上面找得了. 1,账目表主数据 SKA1 SKB1 S ...
- 最受欢迎的前端框架 —— Bootstrap学习
Bootstrap是Twitter的Mark Otto和Jacob Thornton开发的,是目前最受欢迎的前端框架,它简单灵活,使得Web前端开发更加快捷方便. 首先,要基本掌握Bootstrap框 ...
- Python 爬起数据时 'gbk' codec can't encode character '\xa0' 的问题
1.被这个问题折腾了一上午终于解决了,再网上看到有用 string.replace(u'\xa0',u' ') 替换成空格的,方法试了没用. 后来发现 要在open的时候加utf-8才解决问题. 以 ...
- 用html+css+js实现选项卡切换效果
文章转载自:http://tongling.github.io/JSCards/ 用html+css+js实现选项卡切换效果 使用之前学过的综合知识,实现一个新闻门户网站上的常见选项卡效果: 文字素材 ...
- PHP里获取一维数组里的最大值和最小值
<?php $arr = ['10','100','50','90','2','5']; $min = min($arr); $max = max($arr); echo $min.PHP_EO ...
- leecode第一百二十一题(买卖股票的最佳时机)
class Solution { public: int maxProfit(vector<int>& prices) { int len=prices.size(); ) ; v ...
- leecode第九题(回文数)
class Solution { public: bool isPalindrome(int x) { ) return false; ;//这里使用long,也不判断溢出了,反正翻转不等就不是回文 ...
- 浏览器缓存之Expires Etag Last-Modified max-age详解
前段时间去面试移动端的H5开发工程师,在最后面试的时候被问到了max-age Expires Etag有什么不同,在什么情况下应用,当时乱编了一通,自我感觉良好,结果…… 大家懂得,现在讲他们几个的区 ...
- css sticker footer
.detail position: fixed z-index: 100 top: 0 left: 0 width: 100% height: 100% overflow: auto .detail- ...
- nodejs实现文件的拷贝复制
var fs = require( 'fs' ), stat = fs.stat; /* 05 * 复制目录中的所有文件包括子目录 06 * @param{ String } 需要复制的目录 07 * ...