PDF file being sent to printer not pdf file

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
MPrivott
Posts: 1
Joined: Mon Apr 07 2003
Location: Mooresville, NC USA
Contact:

PDF file being sent to printer not pdf file

Post by MPrivott »

I have tried everything in vain to get this to work. I am using VFP6 SP5 w/ Amyuni 2.07. My app has worked fine for the past month or so, only to have this problem crop up and not all the time at that! I have also replaced the tag and tag2 fields w/ nothing as earlier post have mentioned. If I remove the items in the expr field as suggested, I get a printer driver problem. I also have tried your version of Amyuni 2.10 but has less success. My computer seems to have the probelm less frequently - however the clients computer the sucess rate is awfull.

The following is the code used:
lcSavePrinter = set('printer',2)
oPDF = createobject("cdintf.cdintf")
oPDF.driverinit("TW_PDF")
oPDF.setdefaultprinter()
oPDF.filenameoptions = 1 + 2 && noprompt + usefilename
* --
oPDF.defaultdirectory = alltrim(justpath(outfile))
oPDF.DefaultFileName = alltrim(forceext(outfile, 'pdf'))
* --
set printer to "TW_PDF"
report form (rep_name) to printer noconsole
* --
oPDF.restoredefaultprinter()
oPDF.filenameoptions = 0
oPDF.driverend()
release oPDF
set printer to name (lcSavePrinter)
rborup
Posts: 3
Joined: Fri Oct 04 2002

Post by rborup »

> I have also replaced the tag and tag2 fields w/ nothing as earlier post have mentioned.
> If I remove the items in the expr field as suggested, I get a printer driver problem.


You don't want to remove all of the items in the expr field of the first record of the FRX file, just comment out the ones that pertain to a specific printer. There is an example of this in my reply in the "report prints to printer, not PDF; conflict with Acrobat" thread here in this forum. HTH.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

In our VFP technical note we are using:
SET PRINTER TO NAME printername
REPORT FORM authors.frx NOEJECT NOCONSOLE TO PRINTER
Instead of:
set printer to "TW_PDF"
report form (rep_name) to printer noconsole
I a not sure if this will make any difference.
But I would like you to open your VFP report in Design mode and set the printer to "TW_PDF". Then close your VFP application and launch it again.
As you know, the issue you are getting maybe due to the fact that the report in VFP is printed to its own printer and not to the default printer on the system. So if you set its printer to "TW_PDF" instead of making it printer independent, this may help.

Also, please note that version 2.1 will not have any positive or negative inpact on this issue. To use version 2.1 you need to call EnablePrinter() before each printout.

Hope this helps.
Post Reply