[Solved] setdefaultprinter seems do not work the second time

If you are a VFP developer and have any questions about using our products from VFP here is the place to post them.
Post Reply
agp
Posts: 5
Joined: Fri Oct 11 2002

[Solved] setdefaultprinter seems do not work the second time

Post by agp »

Hi,
I have a problem using pdf converter developer. The first time I use it, all works fine but, trying another time the 'setdefaultprinter' command seems to do nothing and sends the report to my printer. Restarting my computer all works again.
The code I'm using in VFP 5.0 is:

impresora = set("printer", 2)
pdf = createobject("cdintf.cdintf")
pdf.pdfdriverinit("agp_pdf")
pdf.setdefaultprinter()
pdf.filenameoptions = 1 + 2 && noprompt + usefilename
*
pdf.defaultdirectory = m.dire
pdf.defaultfilename = m.fichero
report ... to printer noconsole
*
pdf.restoredefaultprinter()
pdf.filenameoptions = 0
pdf.driverend()
release pdf
set printer to name (m.impresora)

¿What can I do with this?
Thanks in advance


Carlos Yohn Zubiria
Aplicaciones de Gestión y Productividad (A.G.P.) S.L.
agp@kender.es
agp
Posts: 5
Joined: Fri Oct 11 2002

Post by agp »

I've solved this problem adding the line
set printer to agp_pdf
before printing.
Post Reply