Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

API call to BullZip PDF Printer with VFP 9

Status
Not open for further replies.

sdocker

IS-IT--Management
Aug 12, 2010
218
GB
I use the function below, (which calls SHELLEXECUTE),to create the bullzip config file.

= ExecuteShell("BZCONFIG.EXE", "", "", ' /S
ShowSettings "NEVER"')

Sadly, I have to make 4 sepatrate calls, which takes time, as I have to wait about 1.5 seconds between each call to be sure that the previous call has completed successfully.


I contacted BullZip regarding 1 call with multiple settings, and got the following response.

Sorry. One setting one call. If you want
to set multiple settings in a more elegant
way then you can use the API.


Does anyone know where I can some sample code as a starting point. I tried BullZip's site, but it was beyond my scope of knowledge.

Thanks,
Sam

 
I use Bullzip all the time and I never have to access the Config file.

I pre-configure Bullzip on the workstation through its desktop GUI to ALWAYS output in the same manner to the same directory and ALWAYS use the same filename. Then I let my VFP application do what it needs to do with the PDF file once it is created.

By 'knowing' where the new PDF file is and what its default file name will be, the application can then MOVE the file and, if necessary, rename it along the way.

From that point it can do whatever it needs to do with the PDF file (e.g. Attach it to an email, Send it via FTP, etc.)

And I do not launch Bullzip with SHELLEXECUTE, but instead I have my VFP application use Windows Scripting to temporarily change the workstation default printer to Bullzip. I then print my document to the new default printer (now using Bullzip), and then immediately use Windows Scripting to return the workstation default printer to its original setting.

That works well for my clients when they create 100's of PDF documents per day via the VFP application.

While investigating a similar posting in another VFP forum I looked at manipulating the parameters in the Bullzip Config file. Like Bullzip told you, it was not done via SHELLEXECUTE, but instead by using the Bullzip API.
createObject("Bullzip.PDFPrinterSettings")
However it turned out that it wasn't worth the trouble since the parameter access was limited and still would not meet that individual's specific needs.

Good Luck,
JRB-Bldr
 
Thanks JRB-Bldr,

I had to rely on google to find some sample code that could guide me.

I am working with a distributable APP and cannot rely on the user to use the BZ GUI.
My code below does a good job for me. Hopefully someone else will also benefit from it.
Thanks for pointing me in thr right direction.

BZWriter = CREATEOBJECT("BullZip.PDFPrinterSettings")
WITH BZwriter
.SetValue ("output", &xToPDF)
.SetValue ('ShowSettings', 'NEVER')
.SetValue ('ConfirmOverwrite', "&qBZConfirm")
.SetValue ('ShowPDF', "&qBZShowPDF")
.WriteSettings(.T.)
ENDWITH

Sam
 
I am glad you found what you needed.

The problem with doing it your way is that only a few of the parameters are available to set.

I know that for my clients' purposes and for the individual on the other forum site that I assisted, there was more need than the few supported parameters could handle.

You might also want to consider modifying the Bullzip Settings just by editing the INI file with your VFP Application.

I found my Bullzip Settings.ini file (settings@Bullzip PDF Printer.ini) in the directory:
C:\Documents and Settings\<username>\Application Data\Bullzip\PDF Printer

Good Luck,
JRB-Bldr
 
There are many more settings that can be modified this way, but these 4 are all I need.

I found that with a distributed APP, the less I mess with files on their systems, the better.

Thanks again for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top