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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default destination for output pdf file (Bullzip).

Status
Not open for further replies.

AndrewMozley

Programmer
Oct 15, 2005
621
GB
This may not be strictly a VFP matter. I am using Bullzip as a pdf printer from VFP (under Windows 7). This works fine. If I am doing this under program control I can specify (among other things) the destination folder where the pdf file is to be written.

The user may however ask for the report to go to a (general) printer; when the REPORT FORM command is executed he is taken to the standard dialogue for selecting a printer. On my installation, if he selects ‘Bullzip PDF Printer’, the default destination folder is the Desktop.

The user can indeed navigate to a different folder for the current output file. I would like to be able to set the default folder so that that is the folder which is offered when he selects this pdf printer.

I understand that there is a registry setting Software\Bullzip\PDF Printer\default. I have tried changing this by using Regedit but without success. Dangerous stuff, but I would like to know what I need to change in the registry (if that is the way to go), and how I can do this from within my VFP application.

Thanks. Andrew
 
See registry.vcx in the FFC classes, and the samples that demonstrate using it in VFP's Samples folder.

I haven't tried this but I'll bet a quick Google search on VFP's registry.vcx will turn up a wealth of information including links to more than a few conversations here about it. [bigsmile]
 
There are several threads here on bullzip pdf, ie by yourself:
thread184-1753102

Maybe test my last answer there.

Bye, Olaf.
 
I would like to be able to set the default folder so that that is the folder which is offered when he selects this pdf printer.

Bullzip installs with its own configuration GUI which may or may not be used.

For my clients I find it very helpful to use this to set a specific default directory and then have the VFP application "pick up" the PDF file (since it now 'knows' where to find it) and then move it to wherever else it needs to go - renaming it on the way if necessary.

This approach (or part of it) could be used to get Bullzip to do what you want.

Good Luck,
JRB-Bldr
 
Thank you JRB, for your helpful and considered reply which will put me on the right track.

For outputting to Bullzip within my application, I adopt a similar approach to you, and (for a particular user) always put the .pdf files into a specific subfolder - he can then move it if he wants.

What I am trying to achieve is when he asks just to print (which invokes my REPORT FORM command with the PROMPT option). This then brings up the standard Windows printer selection window. If he then selects the Bullzip printer, I would like the default folder to be the same as if he was printing to Bullzip under the application’s control.

I see that there is a Bullzip settings file. On my machine it is at :

C:\users\dell\Appdata\roaming\PDF Writer\Bullzip.PDF Printer\settings.ini (So I was probably mistaken in thinking that these settings were in the registry).

I would like to be able to change this setting within my application, by altering this settings.ini file. Or should I just instruct the user to find the Bullzip PDF Printer\settings.ini file (which will be in a different place on his machine)?

Sorry for this rather long explanation, but if you have any further ideas JRB, I will be grateful.

Andrew
 
I just now installed a new version of Bullzip onto my Win7 machine.
But after doing so I did not find a current INI file like you describe.

I did, however, find an OLD, OLD file: settings@Bullzip PDF Printer.ini from a previous installation and it does contain the line:
output=C:\Users\JRB\PDF Files\<title>.pdf
That would suggest that back then I did configure a default output directory, but not a 'standardized' output file name.

That same line from an even older client installation says:
output=C:\Temp\Lead Images\Replacement.pdf
where both the output directory AND the 'standardized' output filename are defined.

If you are doing this for a client system, you would first need to confirm that the file exists and was where you expected it to be.
Then you could try the following:
1. Copy off the file as a Backup
2. Examine the file contents
3. Use the Bullzip configuration GUI app and configure the desired settings
4. Go into the INI file and examine the contents to see if the new setting is reflected.
If all that worked and you wanted a more dynamic user-centric operation, you could have your VFP application make the INI file change on its own. (* to do so I would use FILETOSTR() - make the change to the string - then write it back out with STRTOFILE() *)

However I never needed to do any of that.
Instead I had the app go ahead and use the pre-configured output directory and 'standardized' file name.
Then the user could use GETDIR() to define a desired output directory and the app could MOVE it (actually a COPY FILE command followed by a 'house cleaning' DELETE of the original), renaming the file along the way.

Good Luck,
JRB-Bldr



 
Please, go with the COM API, if you don't yet understand

1. the biuoPDF is compatible with bullzip or vice vers, just use the word bullzip instead of biopdf in class names.
2. The WriteSettings(.T.) call just writes the RunOnce settings for next run, but the methdo can also be called with a member of an enumeration)
3. VFP has no enumerations but a member of an enumeration just is a number. There are setting type "Settings" (1), "User" (2), "RunOnce" (3), "Global" (4), "Defaults" (5).

So saving global settings via WriteSettings(4) instead of WriteSettings(.t.), which equals the call of WriteSettings(3) (Runonce).

Thats all there is to it according to documentation. I'm not installing this, as I don't need it. I can't install everything being asked about.

Bye, Olaf.

PS: From the settings scopes it works this way: RunOnce settings override any setting for the next run, Global settings are otherwise global, Default settings is what other settings start with, eg User or Settings settings. There is no setting though, that is overriding all other settings all the time. RUnOnce as said and as the name suggests does so just once. I'm unsure how other settings are prioritized over each other, so either you need to experiment with this or use something else than bullzip in that aspect.

PDFCreator - for example - always prompts for a file name but has a suggestion you can simply take. It's just one click on OK and I'm fine with that, it doesn't overwrite files, another plus. Of course that's not for creating a bunch of pdfs in a batch and unattended, but then you can use the RunOnce setting and set it before each REPORT FORM.

Bye, Olaf.
 
Thanks, Jrb

I am using Bullzip 10.13.2368. My existing code, which prints from within the VFP application says, effectively :

Code:
   oPrint = CREATEOBJECT("BullZip.PDFPrinterSettings")
   oPrint.SetValue("output", “C:\myfolder\pdf_files\myfile.pdf”) 
   oPrint.SetValue("ShowSettings","Never")
   oPrint.WriteSettings(.T.)

So when I subsequently issue the REPORT FORM command, it creates the .pdf file in my specified folder. It does this by creating a file runonce.ini in folder :

C:\users\Dell\appdata\local\PDF Writer\Bullzip PDF Printer

If I change my last command to :

Code:
oPrint.WriteSettings(.F.)

This overwrites the file settings.ini in folder :

C:\users\Dell\appdata\Roaming\PDF Writer\Bullzip PDF Printer

. . and this file location is used when the user prints to Bullzip as a printer (so, from Microsoft Word); this is what I wanted to do.

However the original settings in this file (specifying things like confirmoverwrite, showpdf &c) are no longer present; that is, the new settings.ini only shows my “output” and “Showsettings” options; this settings.ini file is quite short.

I would like to write back the full settings.ini (with my new “Output” option), but leave these original options unchanged. Do you suppose that is possible? Is there perhaps something like an oBullzip.Readsettings() option?

I realise that I could edit the settings.ini file using the STRTOFILE() function, as you suggested; but I have not been able to determine the location (in general) of this file.

Andrew



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top