64位win7下部署web

来源:互联网 发布:nginx反向代理 编辑:程序博客网 时间:2024/06/10 16:53

在64位操作系统下,如何让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使配置生效。

 

最后补充:

有一天,发现2件事,一个好事一个坏事:

(1)这种情况下生成的PDF是彩色的,而以前32位下生成的是黑白的。这个是好事。

(2)这种情况下生成的PDF是不带图形的,也就是说,你在DW中添加了诸如picture这样的控件,那么对不起了,PDF里不显示。BITMAP函数的计算列显示的图形也会不见了。

经过网友“上海-盛永翔”提醒:绝对路径是好用的,于是测试,结论如下:

最后确认:用这个HP的驱动,的确能使64位下能正确生成PDF

但是:
在.NET网页中,用./images/aa.jpg可以显示图形,但是在打印的PDF中不可以显示图形
在.NET网页中,用c:\wwwroot\webpage\images\aa.jpg不可以显示,但是在打印的PDF中可以显示图形
所以,需要显示时候用./images/**.jpg表示,在生成PDF是必须用c:\wwwroot\webpage\images\**.jpg的路径来表示图形

看你自己怎么发挥了,我是在另存为PDF时候,去MODIFY picture控件的filename属性。

 

 

====以下英文文档可以不看,大部分是废话,按上面的方法设置打印机权限部分即可。========

 

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.

 

Exposing printer settings to the SYSTEM account

 

When a printer is installed on a computer, its settings are stored in the HKEY_CURRENT_USER registry key. IIS runs under the context of the local SYSTEM account. It has access to the HKEY_USERS registry key, but not to the HKEY_CURRENT_USERS subkey, which is only available to a user logged on to the computer.

 

By default, no printers are defined in the HKEY_USERS key. You can add them by exporting three keys from the HKEY_CURRENT_USERS key and importing them to the HKEY_USERS key.

 

注意:

Incorrectly editing the registry might severely damage your system. Make sure you back up valued data before making changes to the registry.

先备份注册表.

 

To make printer settings available to the SYSTEM account:

1 Check that the current user on the Web server has the required printer(s) installed.

2 To launch the Registry Editor, type regedit in the Start>Run dialog box and click OK.

3 Select the HKEY_USERS\.DEFAULT\Software\Microsoft\Windows NT\CurrentVersion key and export the registry key from the File or Registry menu.

4 Specify a name and location in the Export Registry File dialog box and

click Save. This file provides a backup if you need to restore the registry.

5 In the HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion key, select the Devices subkey and export the registry key.

6 Specify the name devices.reg and a temporary location in the Export Registry File dialog box and click Save.

7 Repeat steps 5 and 6 for the PrinterPorts and Windows subkeys, naming the files printerports.reg and windows.reg.

8 Open devices.reg in Notepad (do not use TextPad or another editor), replace the string HKEY_CURRENT_USER with the string HKEY_USERS\.DEFAULT (note that there is a dot before DEFAULT), and save the file.

9 Repeat step 8 for printerports.reg and windows.reg.

10 Double-click each of the edited files to import them into the registry.

11 Restart IIS so that the configuration changes take effect.

 

To restart IIS:

1 In the Windows Start>Run box, type InetMgr.

2 In the IIS Manager, right-click the local computer and select All Tasks>Restart IIS.

3 In the Start/Stop/Reboot dialog box, select Restart Internet Services on ComputerName, where ComputerName is the local computer.

 

After restarting IIS, you need to restart the Web site.

 

DW保存PDF(saveas)必须满足如下要求:

(1)Configure the .NET Framework to run under the SYSTEM account and expose printer settings to the SYSTEM account as described in “Serverside printing” on page 208.

(2)Make sure that the Sybase DataWindow PS profile is exposed to the SYSTEM account as described next.

(3)Create a folder on the server in which to save the PDF files and set its permissions so that the ASP.NET application process has write access to it.

 

On Windows 2003 Server, a default Group Policy disallows installation of printers that use kernel-mode drivers, and as a result the driver used by the Sybase DataWindow PS profile is not installed. Kernel-mode drivers have access to system-wide memory, and poorly written drivers can cause system failures. To allow installation of kernel-mode drivers, follow these steps:

  1. Select Run from the Windows Start menu.
  2. In the Open box, type gpedit.msc and click OK.
  3. In the Group Policy console, expand Computer Configuration, Administrative Templates, and Printers.
  4. Disable “Disallow Installation of Printers Using Kernel-Mode Drivers.”
0 0
原创粉丝点击