无法在 Windows 7 上将 PB 10.5 另存为 PDF
我有一个内置于 10.5 的应用程序,能够在 Windows XP 上使用 SaveAs 成功创建 PDF。当我迁移到 Windows 7(32 位)时,它失败并返回 -1 和零长度文件。
我已经尝试了我能想到的一切。我尝试了多个版本的 Ghostscript(8.54、8.71、9.01),删除了驱动程序并重新添加了它。我还将 Ghostscript EXE 和 DLL 复制到我的应用程序目录中。
系统变量包括 GS_DLL=C:\Program Files\gs\gs9.01\bin\gsdll32.dll 和具有 C:\Program Files\gs\gs9.01\bin\ 的 PATH;在其中(尝试在路径中列出第一个和最后一个)。
当我添加“Sybase DataWindow PS”打印机时,我指定“C:\Program Files\gs\gs9.01\lib\”作为文件夹。我尝试过共享和不共享打印机。
我检查了在PB 10.5中将数据窗口另存为PDF<中提到的所有内容< /a> 但仍然失败。
我束手无策......还有其他想法吗?
--
-- 2011 年 3 月 2 日添加了更多信息
我应该注意这是 PB10.5 -- 不确定这是否重要。我还设置了 Windows 安全性,以便收到所有烦人的用户帐户控制消息框。
这是我添加打印机的方法 - 我相信它是正确的
添加打印机 使用现有端口,文件:(打印到文件) 对于司机 -- 有磁盘,选择“c:\Program Files\gs\gs9.01\lib\ghostpdf.inf” --(替换当前驱动程序) 给它命名为: Sybase DataWindow PS(已确认拼写)
当我打印测试页时,它会创建一个 177KB PDF 文件,但当我打开它时,出现错误:“Adobe Reader 无法打开 'test.pdf',因为它不是受支持的文件类型或因为文件已损坏(例如,它作为电子邮件附件发送且未正确解码)。
当我尝试
使用 dw_1 从 PB 应用程序打印 内容时,出现同样的错误。 .saveAs( "c:\test\test.pdf", PDF! ) 它返回 -1 并创建一个 0 大小的 PDF。
已经应用了最新的 Adobe 更新(似乎每天都会更新!)。
我 注册表项 HKLM\SOFTWARE\GPL Ghostscript\9.01\ 的值如下: GS_DLL (REG_SZ) 设置为 C:\Program Files\gs\gs9.01\bin\gsdll32.dll
GS_LIB (REG_SZ) 设置为 C:\Program Files\gs\gs9.01\lib;C:\Program Files\gs\fonts
DLL 确实存在于该目录中,并且 GS_LIB 引用的两个目录存在并具有内容。
谢谢!
D
I have an application built in 10.5 that was able to successfully create PDFs using SaveAs on Windows XP. When I moved to Windows 7 (32-bit), it failed by returning -1 and a zero length file.
I have tried everything I can figure out. I have tried numerous version of Ghostscript (8.54, 8.71, 9.01), deleted the driver and re-added it. I copied the ghostscript EXEs and DLLs into my application directory as well.
System variables include a GS_DLL=C:\Program Files\gs\gs9.01\bin\gsdll32.dll and a PATH that has C:\Program Files\gs\gs9.01\bin\; in it (tried it listed first and last in the path).
When I add the 'Sybase DataWindow PS' printer, I specify 'C:\Program Files\gs\gs9.01\lib\' as the folder. I have tried sharing and not sharing the printer.
I checked everything mentioned in Saving a datawindow as PDF in PB 10.5 and that still failed.
I'm at wits end... any other ideas?
--
-- More information added 2-MAR-2011
I should note this is PB10.5 -- not sure that matters. I also have my Windows security set up so that I get all the annoying user account control message boxes.
Here is how I added the printer - I believe it's all correct
Add A Printer
Use Existing Port, FILE: (Print to File)
For Driver
-- Have disk, selected "c:\Program Files\gs\gs9.01\lib\ghostpdf.inf"
-- (replace current driver)
Named it:
Sybase DataWindow PS (confirmed the spelling)
When I print a test page it creates a 177KB PDF file, but when I open it, I get an error: "Adobe Reader could not open 'test.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded).
Same error when I try to print something from notepad to it.
When I print from the PB app using dw_1.saveAs( "c:\test\test.pdf", PDF! ) it returns a -1 and creates a 0 sized PDF.
I have applied the most recent Adobe update (seem to get those daily!).
I confirmed I have a registry key HKLM\SOFTWARE\GPL Ghostscript\9.01\ with values:
GS_DLL (REG_SZ) Set to C:\Program Files\gs\gs9.01\bin\gsdll32.dll
GS_LIB (REG_SZ) Set to C:\Program Files\gs\gs9.01\lib;C:\Program Files\gs\fonts
The DLL does exist in that directory and the two directories referred to by GS_LIB exist and have contents.
Thanks!
D
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我感受到你的痛苦。一年前我经历了这整件事。
它的工作方式是 PowerBuilder 将其输出发送到打印机驱动程序。打印机驱动程序输出 postscript (.ps) 文件。 Ghostscript 获取此文件并输出 PDF 文件。如果您收到 0 字节的 PDF,则可能是您的 Ghostscript 设置有问题。
要检查的事项:
注册表项(我认为)应该是这样的:
HKLM\软件\GPL Ghostscript\8.63
GS_DLL应该指向gsdll32.dll(可能在你的ghostscript bin文件夹中)
GS_LIB 是路径列表(lib、font、resource)
I feel your pain. I went thru this whole thing a year ago.
The way it works is that PowerBuilder sends its output to the printer driver. The printer driver outputs a postscript (.ps) file. Ghostscript takes this file and outputs a PDF file. If you're getting a 0 byte PDF, it may be that something is wrong with your Ghostscript setup.
Things to check:
The registry entries (I think) should be something like this:
HKLM\SOFTWARE\GPL Ghostscript\8.63
GS_DLL should point to gsdll32.dll (probably in your ghostscript bin folder)
GS_LIB is a list of paths (lib, font, resource)
当我看到你的问题时,我意识到我当前使用的笔记本电脑无法生成 PDF。这是我尝试过的,包括:
了所有这些都失败了,我可能会使用进程监视器来尝试找出没有建立连接的地方。 (PB 使用打印机驱动程序创建 PostScript、.ps 文件,由 GhostScript 处理。)
可能无法判断我刚刚经历的情况是否对您的情况有任何影响,但也许它会有所帮助。 Sybase 新闻组 中充满了向其他遇到问题的人讲述自己故事的人;这种集成可能是 PB 中最有问题的。
祝你好运,
特里。
对 2011 年 3 月 2 日附录的回应
。好的,所以我不完全确定 Ghostpdf.inf 应该做什么(我的猜测是它想直接创建 PDF),但这不是推荐的。您需要的是一个能够生成 PostScript 文件的打印机驱动程序,如手册中推荐的“HP Color LaserJet PS”,指向 File: 端口,并重命名为“Sybase DataWindow PS”。重命名通过安装 Adobe 打印机驱动程序创建的打印机也足够了。
When I saw your question, I realized the laptop I was currently using wasn't producing PDFs. Here's what I tried, flailing included:
Had all that failed, I probably would have been down to using Process Monitor to try to figure out where the connections weren't being made. (PB uses printer driver to create a PostScript, .ps, file, which GhostScript processes.)
There's probably no way to tell if what I just experienced has any bearing on your situation, but maybe it will help. The Sybase newsgroups are full of people telling their stories to others that are having problems; this integration is probably the most problematic PB has.
Good luck,
Terry.
Response to 2-MAR-2011 Addendum
Yikes. OK, so I'm not entirely sure what ghostpdf.inf is supposed to do (my guess is that it wants to create a PDF directly), but it's not what's recommended. What you want is a printer driver that will produce a PostScript file, like "HP Color LaserJet PS" recommended in the manuals, pointed to File: port, and renamed to "Sybase DataWindow PS". Renaming the printer created by the installation of the Adobe printer driver would have sufficed as well.
我的答案也许很简单。
我一直在做很多尝试来让它适用于所有最新版本的 Ghostscript。最终使其正常工作的解决方案是仅使用 GhostScript 8.70,而不是任何其他版本,并使用此版本中的 Ghostpdf.inf 文件。出于某种原因,我无法解释为什么,这似乎有效......
My answer is maybe as simple as it can get.
I have been doing a lot of attempts to get this working with all of the recent versions of Ghostscript. The solution that finally got it working was just to use GhostScript 8.70, not any other version and to use the ghostpdf.inf file from this version. For one reason or another, I can't explain why, this seems to work...
我们使用的是 Powerbuilder 11.5,ghostscript 在 Windows XP 上运行良好。
当我们将 PB 11.5 迁移到 Windows 7 64 位时,尝试了所有方法,最后致电 Sybase 技术支持。即使在 PowerScript 中也是如此。请注意,Windows 7 不支持 PB 11.5,但技术非常好。 Windows 7 支持 PB 12.5。
在 Windows 7 64 位上,有一个开放的 CR 710061(错误报告),表明 64 位 Ghostscript 无法与 PB 12 或 12.5 一起使用。该错误自 5 月底以来一直存在,尚未在任何版本中修复。由于 PB 11.5 不再受支持,因此在解决此问题时不会在该版本中修复该问题。
我刚刚下载了最新版本的 Ghostscript 9.06 64 位,并按照下面的解决方法进行操作,现在它对我有用。我用 PB 12.5 对此进行了测试,但 PB 11.5 应该是相同的。
CR 710061 - SavesAs PDF 不适用于 64 位 Windows 7
PowerBuilder 12.1 和 12.5 上的 Ghostscript 9
Windows 7 64 位
Windows 2008 64 位
GhostScript 9.x 64 位
尝试使用 GhostScript 9 将行另存为 PDF 时失败
64 位 Windows。可能存在几个问题,包括安全问题。
对于 64 位版本的 GhostScript,该应用程序名为 gswin64c.exe
而不是 gswin32c.exe。 PowerBuilder 查找 gswin32c.exe 而不是 gswin64c.exe
作为 64 位 Windows 7 上的解决方法,我也能够让它工作
使用 64 位版本的 gs905 驱动程序,通过:
添加新打印机作为打印到文件并使用“从磁盘安装”选项;
然后浏览到 Ghostscript \lib 文件夹并选择文件 Ghostpdf.inf。
打印机必须名为“Sybase DataWindow PS”。
对于 32 位操作系统,ghostscript 32 位版本应按照手册中的说明工作。链接如下。
http://infocenter.sybase.com/help /topic/com.sybase.dc37774_1150/html/apptech/BABGDBHJ.htm
We are using Powerbuilder 11.5 and ghostscript worked fine on Windows XP.
When we moved PB 11.5 to Windows 7 64 bit, tried everything and finally called Sybase Tech Support. This works, even from PowerScript. Note that PB 11.5 is not supported for Windows 7 but the tech was gracious. PB 12.5 is supported on Windows 7.
On Windows 7 64 bit there is an open CR, 710061, (bug report) that the 64 bit Ghostscript does not work with PB 12 or 12.5. This bug has been open since the end of May and has not yet been fixed in any version. As PB 11.5 is no longer under support, it would not be fixed in that version when this is addressed.
I just downloaded the latest version of Ghostscript, 9.06 64 bit and following the workaround below it is now working for me. I tested this with PB 12.5 but it should be the same for PB 11.5.
CR 710061 - SavesAs PDF does not work with ghostscript 9 on 64-bit Windows 7
PowerBuilder 12.1 and 12.5
Windows 7 64-bit
Windows 2008 64-bit
GhostScript 9.x 64-bit
When trying to save rows as PDF using ghostscript 9 failed on
64 bit Windows. There might be several issues including security issues.
With the 64-bit version of GhostScript the application is named gswin64c.exe
instead of gswin32c.exe. PowerBuilder looks for gswin32c.exe and not for gswin64c.exe
As work-around on 64-bit Windows 7 I was also able to get it to work
with the 64-bit version of the gs905 driver through:
Add a new printer as printing to file and use the "have disk" option;
then browse to the ghostscript \lib folder and select the file ghostpdf.inf.
The printer must be called "Sybase DataWindow PS".
For 32 bit operating systems, the ghostscript 32 bit versions should work as documented in the manuals. Link is below.
http://infocenter.sybase.com/help/topic/com.sybase.dc37774_1150/html/apptech/BABGDBHJ.htm