我们有Adobe PDF编写器,并希望能够使用此代替ghostscript。 SaveAs()函数是否被锁定到ghostscript中,如果是这样,我该如何使用adobe pdf编写器来解决这个问题?Powerbuilder 9-如何使用adobe writer而不是Ghostscript for SaveAs()
回答
我认为这可能是解决方案:
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.dc00844_1150/html/pbug/pbug526.htm
关键的变化是,你需要创建自己的打印机不使用GhostScript的文件比附带的Adobe文件。
我认为你应该以这种方式创建的Adobe PDF打印机:
http://www.ehow.com/how_5782035_add-adobe-pdf-printer.html
所以,你应该添加本地打印机使用本文件:
C:\ Program Files文件\ Adobe \ Acrobat 9.0 \ Acrobat \ Xtras \ AdobePDF“点击 ”AdobePDF.inf“
t他的代码应该类似于以下内容:
int li_ret
dw_1.Object.DataWindow.Export.PDF.Method = Distill!
dw_1.Object.DataWindow.Printer = "YourAdobePDFPrinterName"
dw_1.Object.DataWindow.Export.PDF.Distill.CustomPostScript="Yes"
li_ret = dw_1.SaveAs("custom.PDF", PDF!, true)
当然,打印还有许多其他问题。随意问!
溴.:的Gabor
另存为()函数依赖于使用的Ghostscript,使用Adobe Acrobat进行打印,你把它当作一个普通的打印机。希望PB 9具有这些功能,因为它取自PB 11.5。
RegistrySet("HKEY_CURRENT_USER\Software\Adobe\Acrobat Distiller\9.0\AdobePDFOutputFolder", "", ReguLong!, 2)
RegistrySet("HKEY_CURRENT_USER\Software\Adobe\Acrobat Distiller\9.0\AdobePDFOutputFolder", "2", RegString!, "C:\_APPS")
//Gets the default printer
ls_default = PrintGetPrinter()
//Parses string
ll_pos = Pos(ls_default, "~t")
is_default_printer = Left(ls_default, ll_pos - 1)
//Gets the Printers on the computer
ls_printers = PrintGetPrinters()
//Finds the Distiller printer
ll_pos = PosA(ls_printers, "Acrobat Distiller")
//Checks for newer version of Distiller
if (ll_pos = 0) then
ll_pos = PosA(ls_printers, "Adobe PDF")
end if
//Gets the location of the Distiller printer
ls_printer = MidA(ls_printers, ll_pos, PosA(ls_printers, ":", ll_pos) - ll_pos + 1)
//Sets our next print ll_job to print to Distiller
PrintSetPrinter(ls_printer)
//Allocates memory for our DS
DS = create DataStore
//Opens Print Job
ll_job = PrintOpen("MyPDF", false)
//Checks for error
if (ll_job > 0) then
//First Datastore to add to the PDF
DS.DataObject = "d_wlcp_view"
DS.SetTransObject(SQLCA)
DS.Retrieve(idt_review_date, ii_site_id)
PrintDataWindow(ll_job, DS)
//You can add more pages to the PDF by printing more DW's or DS's
DS.DataObject = "d_training_view"
DS.SetTransObject(SQLCA)
DS.Retrieve(idt_review_date, ii_site_id)
PrintDataWindow(ll_job, DS)
//Closes the print job
PrintClose(ll_job)
//Sets the default printer back
PrintSetPrinter(ls_default)
//Sometimes the PB function doesn't set the printer back, so you can use
//this VB script to make sure it is set back to the default
//Run('cscript C:\_APPS\HWLCPRR\prnmngr.vbs -t -p "' + is_default_printer + '"')
//Deallocates memory for DS
if (isValid(DS)) then destroy DS
在我尝试这个之前,我试图将数据窗口保存为pdf文档,以便我可以通过电子邮件发送。这会做到吗? – 2013-03-12 16:29:25
我试过了,它确实创建了pdf文件。我希望该文件自动转到我在代码中提供的文件夹中。有什么办法可以动态设置adobe pdf打印机的默认文件夹吗?用户可以从出现的对话框中做到这一点,但用户无法知道该文档应该放在哪里。 – 2013-03-12 17:03:00
请参阅我的修改后的脚本,查看顶部的两行新代码。当然,根据您使用的Acrobat版本,注册表项会有所不同,因此您可以检查注册表以查找正确的文件夹。另外,如果您的用户使用Acrobat作为他们的打印机之一来创建自己的PDF,那么您可能需要添加其他代码以保存默认设置,然后将其重新设置为该设置。 – 2013-03-12 22:41:45
- 1. Powerbuilder ImportFile/SaveAs
- 2. Powerbuilder 11.2 webform saveas不工作
- 3. 使用excel保存而不是saveAs activeX
- 4. 创建16:9视频而不是4:3 - AVAsset Writer - iPhone
- 5. 如何从Adobe Flash Player 9(而不是10)干净地卸载Adobe Captivate SWF
- 6. Pdf Writer for Rails 3
- 7. Saveas在运行exe时不适用于Powerbuilder 12.5中的任何文件类型
- 8. 在for循环中使用Ghostscript
- 9. 使用for循环,而不是地图
- 10. 使用reduce而不是for循环
- 11. 什么使用,而不是FileReader for Safari?
- 12. 如何使用的Ghostscript
- 13. 如何使用的Ghostscript
- 14. 如何使用Adobe Reader Mobile SDK 9开发pdf/epub阅读器?
- 15. 如何在jQuery中使用“For”而不是“each”函数
- 16. 如何在for循环中使用double而不是int?
- 17. for each而不是for循环
- 18. 在Adobe Reader 9中查看书签9
- 19. PowerBuilder,函数saveas在Windows下生成空文件10
- 20. Django:FOO_set.all()for filter()而不是get()
- 21. Android - 为什么要使用cardview而不是9补丁
- 22. atof()for float而不是double
- 23. 如何使用air adobe
- 24. 如何使用for循环而不是while循环使用相同的答案
- 25. 如何使用yield而不是return
- 26. LINQ:如何使用RemoveAll而不使用For循环与数组
- 27. Excel:确定是否使用Save或SaveAs
- 28. 如何使用XML :: Writer插入XML perl
- 29. 如何使用cURL而不是exec()?
- 30. 如何使用this.sample() - 而不是this.cursor.getInt()
我执行了上述所有步骤,并通过重命名可执行文件和dll来禁用我的开发机器上的ghostscript。我得到了一个-1作为saveas()的返回值。一旦我将ghostscript文件重命名为原来的名称,并执行了saveas(),但它没有使用adobe writer,而是使用ghostscript蒸馏器。就好像Powerbuilder明确地寻找Ghostscript,即使我改变了上面的列表的代码。 – 2013-03-12 13:42:01