Adobe PDFライターがあり、ghostscriptの代わりにこれを使用できるようにしたいと考えています。SaveAs()関数はghostscriptにロックされていますか?ロックされている場合、adobe pdf writerを使用してこれを回避するにはどうすればよいですか?
2 に答える
これが解決策になると思います:
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.dc00844_1150/html/pbug/pbug526.htm
主な変更点は、Adobe に付属のファイル以外の GhostScript ファイルを使用しない独自のプリンターを作成する必要があることです。
この方法で 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" をクリックします。
この後、コードは次のようになります。
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.: ガボール
SaveAs() 関数は、Ghostscript の使用に関連付けられています。Adobe Acrobat を使用して印刷するには、通常のプリンターとして扱います。これは PB 11.5 から取ったものなので、PB 9 にこれらの機能があることを願っています。
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
これがVBスクリプトです。