在 PB 10.5 中将数据窗口保存为 PDF
我有一个网格数据窗口,背景中有一张图片(A4 页面的尺寸),我想将数据和图片导出为(单页)PDF 文件。我使用了以下命令的几种组合,但最多我得到了 0 大小的 pdf。
//dw_1.Modify("Datawindow.Export.PDF.Method = Distill! ")
//dw_1.Modify("DataWindow.Export.PDF.Method = XSLFOP! ")
dw_1.Object.DataWindow.Export.PDF.Method = Distill!
//dw_1.Object.DataWindow.Printer = "\\prntsrvr\pr-6"
dw_1.Object.DataWindow.Export.PDF.Distill.CustomPostScript="No"
dw_1.SaveAs("c:\dw_one.pdf", PDF!, false)
用户指南(第 533 页)说:
...数据被打印到 PostScript 文件,并使用 GNU Ghostscript 自动提取为 PDF...
安装 Ghostscript
出于许可原因, Ghostscript 不随 PowerBuilder 一起安装。您(和您的用户)必须下载并安装它,然后才能使用此技术...
有人知道这个过程是什么吗?
编辑 谢谢大家。事实证明安装 Ghostscript 就足够了。我只是无法理解为什么在不使用 Ghostscript 的情况下该过程在某些同伴 PC 上成功(使用 Method = XSLFOP!):-/
I have a grid datawindow with a picture in it's background (with dimensions of an A4 page) and I would like to export both data and the picture as a (single page) PDF file. I used several combinations of the following commands but at most I got a 0-sized pdf.
//dw_1.Modify("Datawindow.Export.PDF.Method = Distill! ")
//dw_1.Modify("DataWindow.Export.PDF.Method = XSLFOP! ")
dw_1.Object.DataWindow.Export.PDF.Method = Distill!
//dw_1.Object.DataWindow.Printer = "\\prntsrvr\pr-6"
dw_1.Object.DataWindow.Export.PDF.Distill.CustomPostScript="No"
dw_1.SaveAs("c:\dw_one.pdf", PDF!, false)
User’s guide (on page 533) says:
… the data is printed to a PostScript file and automatically distilled to PDF using GNU Ghostscript…
Installing Ghostscript
For licensing reasons, Ghostscript is not installed with PowerBuilder. You (and your users) must download and install it before you can use this technique…
Does anyone have any idea what is the procedure?
EDIT
THANK YOU ALL. Installing ghostscript proved to be enough. I only cannot understand why the procedure is successful on some fellows PCs (using Method = XSLFOP!) without using ghostscript :-/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
PowerBuilder 的 Ghostscript 和打印机设置
这些说明使用 HP 打印机驱动程序,而不是 Sybase 提供的驱动程序。如果由于某种原因您没有此驱动程序,您可以从 HP 下载。 HP 驱动程序具有以下优点:
所需文件
Ghostscript
安装 gs860w32 .exe
Sybase DataWindow PS 打印机
Ghostscript and Printer setup for PowerBuilder
These instructions use an HP printer driver instead of the one supplied by Sybase. If for some reason you don't have this driver, you can download it from HP. The HP driver has the following advantages:
Needed files
Ghostscript
Install gs860w32.exe
Sybase DataWindow PS Printer
我们已经在这里工作了。从我们的内部 wiki:
推荐)
目录
包含默认后记
Sybase 提供的驱动程序。
来自 Adobe.com)。这个必须命名
“Adobe DataWindow PS”
我们使用的是 1.06 版的 postscript 驱动程序,您可以在此处下载:
We've got it working here. From our internal wiki:
recommended)
directory
containing the default postscript
drivers supplied by Sybase.
from Adobe.com). This must be named
'Adobe DataWindow PS'
We're using version 1.06 of the postscript driver which you can download here:
您的代码看起来不错,并且与我刚刚检查过的执行类似操作的代码一致。验证 Ghostscript 是否已正确安装。
出于调试目的,我会尝试使用更简单的数据窗口,没有位图背景。
Your code looks fine and is in line with my code that I just checked that does something similar. Verify that ghostscript is installed correctly.
For debugging purposes I would try using a much simpler datawindow without the bitmap background.
作为对其他属性的一个小补充,我从来没有必要修改()任何导出属性;我只是另存为()。我的理解是,这些属性是为了尝试走非 Ghostscript 路线,但我不记得听说有人成功地做到了这一点。
为了简化您的测试,您可能想看看是否可以右键单击数据窗口画笔中的预览窗格以查看是否有“将行另存为...”选项。 (我目前没有安装 10.5,所以我无法查看该版本是否可用。)它将节省您运行应用程序的时间,并至少在让它在 PowerScript 中运行之前测试基本功能。
祝你好运,
特里。
As a minor addition to the others, I've never had to Modify() any of the Export attributes; I just SaveAs(). My understanding is that these attributes are for trying to go non-Ghostscript routes, but I don't recall hearing of anyone successfully doing this.
To simplify your test, you might want to see if you can right click on the Preview pane in the DataWindow painter to see if there is a "Save Rows As..." option. (I don't have 10.5 installed at the moment, so I can't see if it's available in that version.) It will save you running the app, and at least test the basic functionality before getting it to run in PowerScript.
Good luck,
Terry.
Ghostscript 的问题是驱动程序未签名。这是 Windows 8 中的一个大问题,因为它只会停止驱动程序的安装。 Windows 7 您会被告知发生了什么情况并允许安装驱动程序。 Windows 8 只是停止安装驱动程序,您可以通过尝试使用 Ghostscript 文件创建打印机来证明这一点。
目前正在通过 HP PS 驱动程序尝试找出适用于 Windows 8 操作系统的解决方法。
The problem with ghostscript is that the drivers are not signed. This is a big issue in Windows 8, in that it will just stop the installation of the drivers. Windows 7 you were informed what was happening and allowed to install the drivers. Windows 8 just stops the install of the drivers, you can prove this by trying to create a printer with the ghostscript files.
Currently working through the HP PS drivers to try and identify a workaround for the Windows 8 operating system.
Windows 8 确实允许未签名的打印机驱动程序,但您必须重新启动到“高级模式”,请参阅以下链接中的过程,并选择选项禁用驱动程序签名强制。
http://windows.microsoft.com /en-gb/windows-8/windows-startup-settings-include-safe-mode
Windows 仍会警告并建议不要安装未签名的驱动程序。
Windows 8 does allow unsigned printer drivers but you have to reboot into "advanced mode" see the procedure at the following link and select the option Disable driver signature enforcement.
http://windows.microsoft.com/en-gb/windows-8/windows-startup-settings-including-safe-mode
Windows will still warn and advice against installing an unsigned driver.