Hi,
I’m using PB12.6. I have a web application that need to print the report created by PB. I create a simple assembly in PB.Net to test it. This assembly has a simple function using datastore to save the dataobject as PDF. Some code as below:
datastore n_ds
n_ds = createdatastore
n_ds.dataobject = 'd_test'
n_ds.SetTransObject(sqlca)
n_ds.retrieve()
n_ds.Modify("DataWindow.Export.PDF.Method = Distill!")
n_ds.Modify("DataWindow.Export.PDF.Distill.CustomPostScript=1")
n_ds.Modify("DataWindow.Printer='Generic PostScript Printer'")
return n_ds.saveas('C:\test.pdf', PDF!, false)
I also installed GhostScript 9.05 and a PDF printer called ‘Generic PostScript Printer’. This function is OK in PB with a PDF file is created. But in the web application, this function always return -1 and no file is created. I try to reference to some library of PB but I have the same result.
Can anyone help me?
Richard