在 PB 10.5 中将数据窗口保存为 PDF

发布于 2024-08-26 05:28:35 字数 828 浏览 7 评论 0原文

我有一个网格数据窗口,背景中有一张图片(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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

镜花水月 2024-09-02 05:28:35

PowerBuilder 的 Ghostscript 和打印机设置

需要管理权限
安装打印机。我们正在使用
XP 上的此设置。

这些说明使用 HP 打印机驱动程序,而不是 Sybase 提供的驱动程序。如果由于某种原因您没有此驱动程序,您可以从 HP 下载。 HP 驱动程序具有以下优点:

  • 生成的 PDF 可以通过屏幕阅读器读取(YMMV,但 Sybase 驱动程序输出根本无法读取。)
  • 驱动程序经过数字签名,可以安装在需要的系统上签名驱动程序

所需文件

  • gs860w32.exe 来自 http://pages.cs.wisc.edu/~ghost/ (如果您愿意,可以尝试更高的版本。8.60 对我们来说工作正常。)
  • 驱动程序文件位于 C:\Program Files\Sybase\Shared\PowerBuilder\drivers (路径可能因安装而异)

Ghostscript

安装 gs860w32 .exe

  • 安装到 C:\Program Files\gs
  • 检查所有用户
  • 检查安装 Ghostscript 字体

Sybase DataWindow PS 打印机

打印机名称是
区分大小写并且必须准确无误
引号里面是什么。没有
“数据窗口”中的空间。最简单的方法
正确的做法是从这里复制
文档并将其粘贴到。

  • 打开控制面板、打印机和传真
  • 选择添加打印机(下一步)
  • 选择本地打印机,取消选中自动检测并安装我的即插即用打印机(下一步)
  • 选择使用以下端口,选择文件:(
  • 下一步 在左侧列表中,选择制造商“HP”
  • 在右侧列表中,向下滚动并选择“HP 8150 Series PS”(下一个)
  • 打印机名称“Sybase DataWindow PS”
  • 用作默认打印机 选择“否”(下一个)
  • 保留“执行”不共享所选(下一步)
  • 打印测试页,选择否(下一步)
  • (完成)

Ghostscript and Printer setup for PowerBuilder

Administrative privileges are required
to install the printer. We are using
this setup on XP.

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:

  • Generated PDFs can be read by a Screen Reader (YMMV, but the Sybase driver output isn't readable at all.)
  • Driver is digitally signed for installation on systems that require signed drivers

Needed files

  • gs860w32.exe from http://pages.cs.wisc.edu/~ghost/ (you can try a later version if you like. 8.60 is working fine for us.)
  • Driver files in C:\Program Files\Sybase\Shared\PowerBuilder\drivers (path may vary depending on installation)

Ghostscript

Install gs860w32.exe

  • Install to C:\Program Files\gs
  • Check All Users
  • Check Install Ghostscript Fonts

Sybase DataWindow PS Printer

The printer name is
case-sensitive and has to be exactly
what is inside the quotes. There is no
space in “DataWindow”. The easiest way
to get it right is to copy from this
document and paste it in.

  • Open Control Panel, Printers and Faxes
  • Choose Add printer (next)
  • Choose Local printer, uncheck Automatically detect and install my Plug and Play printer (next)
  • Choose Use the following port, select FILE: (next)
  • In the left-hand list, select 'HP' for the manufacturer
  • In the right-hand list, scroll down and select 'HP 8150 Series PS' (next)
  • Printer name "Sybase DataWindow PS"
  • Use as default printer select No (next)
  • Leave Do not share selected (next)
  • Print test page, select No (next)
  • (finish)
沫雨熙 2024-09-02 05:28:35

我们已经在这里工作了。从我们的内部 wiki:

  • 在您的工作站(8.50 或 8.15)上安装 ghostscript
    推荐)
  • 确保 Powerbuilder DLL 中的 Ghostscript 文件
    目录
  • 确保同一位置有一个目录
    包含默认后记
    Sybase 提供的驱动程序。
  • Powerbuilder 使用 Adob​​e Postscript 驱动程序(可以免费下载)
    来自 Adob​​e.com)。这个必须命名
    “Adobe DataWindow PS”

我们使用的是 1.06 版的 postscript 驱动程序,您可以在此处下载:

We've got it working here. From our internal wiki:

  • Install ghostscript on your workstation (8.50 or 8.15
    recommended)
  • Make sure that the ghostscript files in the Powerbuilder DLL
    directory
  • Ensure that there is a directory in the same place
    containing the default postscript
    drivers supplied by Sybase.
  • Powerbuilder uses the Adobe Postscript Driver (which can be downloaded free
    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:

狠疯拽 2024-09-02 05:28:35

您的代码看起来不错,并且与我刚刚检查过的执行类似操作的代码一致。验证 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.

把时间冻结 2024-09-02 05:28:35

作为对其他属性的一个小补充,我从来没有必要修改()任何导出属性;我只是另存为()。我的理解是,这些属性是为了尝试走非 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.

や莫失莫忘 2024-09-02 05:28:35

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.

偷得浮生 2024-09-02 05:28:35

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文