各位大侠,
我用PB9,调用DW的 saveas的代码如下
dw_2.settransobject(sqlca)
dw_2.retrieve()
STRING ls_file_name
ls_file_name = 'test'
ChangeDirectory('C:\')
dw_2.Object.DataWindow.Export.PDF.Method = Distill!
dw_2.Object.DataWindow.Printer = "PDFCreator" //PDF Architect //PDFCreator
dw_2.Object.DataWindow.Export.PDF.Distill.CustomPostScript="Yes"
dw_2.SaveAs(ls_file_name, PDF!, true)
用到PDFCreator1.9,但是生成的PDF文件,不能查找;
复制其中的文字也是空白或者是乱码,能告诉我怎么回事么?
------解决方案--------------------
FoxitPDFCreator31_x64_enu
是这个东西吗?我打印出来可以查找
------解决方案--------------------
安装一个 PDF虚拟打印机pdfFactory 就能解决你的问题
或者你直接用pb12,支持dw直接saveas成pdf
------解决方案--------------------
使用另存pdf,必须要这个东东
首先我要声明的是,这个方法在PB9+WIN7 64位下不好用。只适用于 PB12, 12.5。PB9的仍然得安装GhostScript 7.05,不能高于这个版本。
1,安装GhostScirpt 8.71
注意版本,高过这个版本就有时不好用。。
2,安装64位的PS打印机驱动程序,将打印机名称设置为 "Sybase DataWindow PS"
注意 打印机驱动可以选用HP的PS打印机。
别看我只写了这2条,我试验了1个星期!
如果自己下载不到,可以到下面这个地址下载去:(注意:要CSDN分)
GhostScirpt 8.71 & HP ps打印驱动
在PB的CS环境中,saveAS 是一般是没有问题的,如果在DW.NET的WEB条件下,调用SAVEas 是不好用的,主要原因是BS条件下,IIS对打印机没有操作权限,也因为权限问题,无法新建文件。经过查询DW.NET的帮助文档,发现按照下面文章所述,是可以进行dw.net的SAVEAS的。
在64位WIN下,DW.net save as PDF时,会提示-1的错误,保存不成功。其原因是:本地系统账号没有获得打印机权限。那么如何修改打印机权限呢?请按下面步骤:
(1) 当前用户在WEBSERVER的打印机需要先安装好。
(2) 在“开始”、“运行”中,运行注册表编辑器:regedit。
(3) 选择HKEY_USERS\.DEFAULT\Software\Microsoft\Windows NT\CurrentVersion, 将之导出为一个注册表备份文件,这个备份文件是以防万一改错了恢复用的。。
(4) 选择HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion,
a) 选择Devices子键,导出文件,文件名为device.reg
b) 选择PrinterPorts子键,导出文件,文件名为Printports.reg
c) 选择Windows子键,导出文件,文件名为Windows.reg
(5) 用记事本或者其他的文本编辑器,
a) 编辑device.reg文件,将HKEY_CURRENT_USER替换成HKEY_USERS\.DEFAULT
b) 编辑Printports.reg文件,将HKEY_CURRENT_USER替换成HKEY_USERS\.DEFAULT
c) 编辑Windows.reg文件,将HKEY_CURRENT_USER替换成HKEY_USERS\.DEFAULT
(6) 保存着3个文件后,双击这3个文件,将注册表内容导入到系统中。
(7) 重启IIS和WEBSITE使配置生效。
====以下英文文档可以不看,大部分是废话,按上面的方法设置打印机权限部分即可。========
If your DataWindow .NET application specifies a path for dynamically generated files, make sure that the ASP.NET account (or, for Windows 2003 server, the IIS_WPG user group) has write permission to the directories. You need to do this if your application uses graphs in Web DataWindows or saves the JavaScript, XML, XSLT, and CSS files generated for XML or XHTML Web DataWindows into separate directories.
The Web server must be configured so that the ASP.NET worker process has access to system settings and the SYSTEM account has access to printers. Implementing server-side printing requires changing the default permissions on the server.
By default, the .NET Framework runs with the permissions of the local “machine” account. In order to print using IIS, the .NET Framework must run with the permissions of the local “SYSTEM” account. The procedures for configuring the .NET Framework for IIS 5.x and 6.x are different.
To configure the .NET Framework to run with local SYSTEM settings with
IIS 6.x:
1 In the Windows Start>Run box, type InetMgr.
2 In the IIS Manager, expand local computer and select Application Pools.
3 Right-click Application Pools and select Properties.
4 Click the Identity tab, select Local System from the Predefined list box,
and click OK.
5 Click Yes in the pop-up warning message window that displays.
6 Right-click local computer and select All Tasks>Restart IIS to restart IIS.