当前位置: 代码迷 >> PB >> dw_1.SaveAs(ls_pdfFilename, PDF! false)=-1解决办法
  详细解决方案

dw_1.SaveAs(ls_pdfFilename, PDF! false)=-1解决办法

热度:621   发布时间:2016-04-29 08:41:03.0
dw_1.SaveAs(ls_pdfFilename, PDF!, false)=-1
dw_1.SaveAs(ls_pdfFilename, PDF!, false)

保存PDF失败的原因会是哪些?




------解决方案--------------------
SQL code
Saving as PDF using the distill methodIf you want to save to PDF using the distill method, you do not need to change any properties. The distill method is used by default when you select Save Rows As from the File menu in the DataWindow painter and select PDF as the file type, or when you use the SaveAs method with PDF! as the file type. PowerBuilder uses a PostScript printer driver specifically designed for distilling purposes to configure the PDF output. You can choose to use a different PostScript printer driver if you want to customize your PostScript settings for generating PDF.In the DataWindow painterTo use a custom PostScript printer driver, you must set some properties. To save customized distilled PDF output in the DataWindow painter:Select the Data Export tab in the Properties view for the DataWindow object.Select PDF from the Format to Configure drop-down list, select Distill! from the Method drop-down list, and select the Distill Custom PostScript check box.Select the Print Specifications tab and specify the name of the printer whose settings you want to use in the Printer Name box.Save the DataWindow object, then select File>Save Rows As, select PDF as the Save As Type, specify a file name, and click Save.In a scriptThe properties you set in the DataWindow painter are saved with the DataWindow object and are used by default when your application runs, but for more control, specify the properties in a script before saving the DataWindow object. To specify a custom printer driver in a script, set the Export.PDF.Distill.CustomPostScript property to Yes and specify a printer with the DataWindow.Printer property:int li_ret  dw_1.Object.DataWindow.Export.PDF.Method = Distill! dw_1.Object.DataWindow.Printer = "\\prntsrvr\pr-6" dw_1.Object.DataWindow.Export.PDF.  &    Distill.CustomPostScript="Yes"  li_ret = dw_1.SaveAs("custom.PDF", PDF!, true)
------解决方案--------------------
是PB哪个版本的?
SQL code
int li_ret  dw_1.Object.DataWindow.Export.PDF.Method = Distill! dw_1.Object.DataWindow.Printer = "\\prntsrvr\pr-6"  //换成您的虚拟打印机名称dw_1.Object.DataWindow.Export.PDF.Distill.CustomPostScript="Yes"  li_ret = dw_1.SaveAs("custom.PDF", PDF!, true)
  相关解决方案