Intermittent error under Foxpro

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
PaulJay
Posts: 2
Joined: Wed Aug 20 2008

Intermittent error under Foxpro

Post by PaulJay »

I use the pdf converter (version 2.5) in my client's visual foxpro7 systems. I access the FLL provided in the download pack in order to programmatically create pdf's with specific file names - I use an amended version of the foxpro program that is (was) also provided (the example is in a form now).

Occasionally, instead of the pdf just being created, the user sees the 'Output File Name' window instead ie they are asked to input the pdf file name. It's exactly the same window that pops up when you print a document when the default printer is set to the 'Amyuni PDF Converter' printer.

Here's the relevant code:-

SET LIBRARY TO <folder name>fllintf250.fll (<folder name> being the folder name where the library is located)
* Set PDF printer
#define printername "Amyuni PDF Converter"
PDF = DriverInit(printername)

- This is all set on entering the system, rather than any time a pdf is created (following advice in the documentation to only set this once) (Nb on leaving the system I issue "DriverEnd( PDF )")

When generating a pdf, the following code is called (many comments from the original program):-

PARAMETERS mrep,mpdf ("mrep" is the relevant foxpro report form for the report; "mpdf" the output pdf file name)
lcDefaultPrinter = SET("PRINTER",3)

#define printername "Amyuni PDF Converter" && define the name of printer already installed on your system.
#define NoPrompte 1 && do not print for file name
#define UseFileName 2 && use file name set by SetDefaultFileName
#define Concatenate 4
#define BroadcastMessages 32 && Enable Brodcast Messages to be able to insert Bookmarks
#define EnableWatermarks 64 && Enable Watermsrks
* here is the definition of the watermark parameters
#define Wfontname "Arial Italic"
#define Wfontsize 40
#define Worientation 0
#define Wcolour 8421504
#define Whorzpos 185
#define Wvertpoz -1080
#define Wforeground .F.

DefaultFileName( PDF,"h:\temp\pdff.pdf") && set output file name
FileNameOptions( PDF, NoPrompte+ UseFileName+ BroadcastMessages + EnableWatermarks) && specify the file options

&& We can also add Watermarks.
SetWatermark( PDF, "", Wfontname, Wfontsize, Worientation , Wcolour, Whorzpos, Wvertpoz, Wforeground )

SET PRINTER TO NAME printername
REPORT FORM (mrep) NOEJECT NOCONSOLE TO PRINTER

FileNameOptions( PDF, 0 ) && reset options

* Now copy from basic pdf in h:\temp to the nominated location
COPY FILE "h:\temp\pdff.pdf" TO (mpdf)
* Set default printer
SET PRINTER TO NAME (lcDefaultPrinter)

Nb I generate the output pdf file by copying to a generic file ("h:\temp\pdff.pdf"). Then just using the foxpro 'COPY FILE' command to copy the pdf to the file name and location I want. Again I do it like this following advice from another forum when trying to solve this problem!

So usually the pdf is created fine: intermittently the 'Output File name' dialog box pops up! I have checked the Tag and Tag2 fields in the report form - they are fine.

Only other thing to mention is that most of the users access the system under Citrix. They all have access to the 'CDINTF250.DLL' file as well.

Help please! This is driving my users crazy - they want me to get another pdf generator now.

regards,

Paul Jay
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Re: Intermittent error under Foxpro

Post by Joan »

Hello,

Your code is fine.

Please check if you have more than one version of CDIntf on your system or if you have more than one PDF Printer installed.

To debug this issue please check that FileNameOptions is taking the right value when running.

Please delete Tag and Tag 2 fields and set the PDF Printer as the default printer for your report then re-run your application.

Try to save the pdf file to a locale drive and not a remote one, will you still get the "output file name" window?
Custom Brand the Amyuni PDF Printer Driver http://www.amyuni.com/en/developer/branding/index.html

Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
PaulJay
Posts: 2
Joined: Wed Aug 20 2008

Re: Intermittent error under Foxpro

Post by PaulJay »

Hi Joan,

The client is still getting this error!

Regarding the points you made in your last email:-

*** Please check if you have more than one version of CDIntf on your system or if you have more than one PDF Printer installed.

Each server used to run the system does have a cdintf.dll & cdintf250.dll file. The client uses the Amyuni PDF Converter & "PDF Factory".

*** To debug this issue please check that FileNameOptions is taking the right value when running.

What do you mean here? Do you want me to check what values are being sent to FileNameOptions every time I create a pdf?

*** Please delete Tag and Tag 2 fields and set the PDF Printer as the default printer for your report then re-run your application.

I did this and have just checked the relevant Tag/Tag2 fields - they still show the amyuni pdf printer.

***Try to save the pdf file to a locale drive and not a remote one, will you still get the "output file name" window?

The pdf file used to be saved to a local drive (on the users' PC) and the problem still occurred.


What now?

Regards,

Paul
Post Reply