首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Powerbuilder 9-如何使用adobe编写器而不是Ghostscript for SaveAs()

Powerbuilder 9-如何使用adobe编写器而不是Ghostscript for SaveAs()
EN

Stack Overflow用户
提问于 2013-03-12 01:47:56
回答 2查看 1.7K关注 0票数 2

我们有Adobe PDF writer,并希望能够使用这一点,而不是ghostscript。SaveAs()函数是否锁定在ghostscript中,如果是,我如何使用adobe pdf编写器来解决这个问题?

EN

回答 2

Stack Overflow用户

发布于 2013-03-12 04:32:38

我认为这可能是解决方案:

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\Acrobat9.0\Acrobat\Xtras\Adobe 9.0“。单击"AdobePDF.inf”

在此之后,代码应该类似于以下内容:

代码语言:javascript
运行
复制
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)

当然,打印可能还有许多其他问题。请随时提问!

Br.:Gábor

票数 2
EN

Stack Overflow用户

发布于 2013-03-12 23:47:38

SaveAs()函数与使用Ghostscript绑定在一起,要使用Adobe Acrobat打印,您可以将其视为常规打印机。希望PB 9有这些功能,因为它取自PB 11.5。

代码语言:javascript
运行
复制
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

Here is the VB Script

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15345160

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档