pdf writer

pdfMachine Technical F.A.Q.


Can I install multiple pdfMachine printers with different options?

 

This is achievable but setup is a bit tricky...
1. Download the pdfMachine.exe self-extracting zip file.
2. Unzip pdfMachine.exe into a temporary directory using a zip utility. eg Winzip, or 7zip.
3. If your system does not have pdfMachine installed, run bgssetup.exe (from the temporary directory) ie: bgssetup.exe -printer="pdfMachine printer 2"
4. Now you have created a printer called "pdfMachine printer 2" with its own configuration options.
5. Run: bgssetup.exe -addPort -printer="pdfMachine printer 3    "
6. This will create a printer called "pdfMachine printer 3" with its own configuration options, and so on...




How do I install pdfMachine on Citrix or Terminal Server?

Here are some notes on terminal server installation that may help:
Click here for licensing information.

Installation of pdfMachine on Terminal Server:

Don't use the control panel add/remove programs to install.  
Don't use the command:  "change user /install"

If you do either of these things terminal server creates "shadow registry" entries which will overwrite valid
pdfMachine registry entries.  If this is done, you need to  uninstall pdfMachine then manually remove any 
shadow registry entries from the registry.  They are usually located under the registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\Install\Software\pdfMachine
Once this is done, reboot, then install pdfMachine 
by running the pdfMachine.exe program under and admin account.

bgsmsnd.exe:
The process bgsmsnd.exe must be running at user logon time.  Each user will have a copy running.  If you publish applications via terminal server then make sure that you add a line to the logon script that executes bgsmsnd.exe, which is located in the printer driver directory, typically: C:\Windows\System32\spool\drivers\w32x86\bgsmsnd.exe

User Options:
The first time a user logs on after pdfMachine is installed, registry entries for all pdfMachine options are created in:
HKEY_CURRENT_USER\Software\pdfMachine. 
These are created using sensible defaults and values saved in the "bgsconf.ini" file.  Bgsconf.ini is located in the printer drvier directory (e.g. C:\Windows\System32\spool\drivers\w32x86\bgsconf.ini)  If you manually edit this file you can
pre-set options that users will end up with.  However, once users logon, then these values will have no more effect.

 





When using Citrix / Windows Terminal Server / Remote sessions, can I initiate a pdfMachine print and have the client side send email / save / view ?

NOTE: This setup is only necessary if you don't want the default behaviour where the server side sends email / saves / views.

This uses a partially implemented feature of pdfMachine that requires some manual setup.

Server machine setup:
Setup pdfMachine to print to a pdf file and update a text file in directory(s) on the server.
1. Install pdfMachine
2. On the "Next Action tab", set the "Next Action" to "execute command line" and the "Command Line" to:
        cscript.exe c:\touchx.js "%s"
NOTE : See the following FAQ about batch files in "Next Action".


3. Create a script  file (e.g. C:\touchx.js) which updates a file (e.g. c:\tmp\x.txt) in a server directory that clients can access. e.g.
        fn = WScript.arguments(0);
        fso = new ActiveXObject("Scripting.FileSystemObject");
        fso.CopyFile(fn, "c:\tmp\x.pdf", true);
        f = fso.CreateTextFile("c:\tmp\x.txt", true);
        f.Close()
 

 

4. Now when a print is done on the server machine, no user interface is presented, the pdf file c:\tmp\x.pdf is generated, and then the file c:\tmp\x.txt is updated.

Client side setup:
Setup pdfMachine to check the server file periodically. The client side must have a drive mapped which allows access to the directory that the server puts the files into (e.g. x.pdf and x.txt above).
 

1. Install pdfMachine
 

2. On the general tab, set "Save Filename action" to "Use the default dir and default save filename" and set the "default directory" and "default filename" to the client side mapping of the path required to access the pdf file (e.g. x.pdf above) on the server.
 

3. Create a new registry string value called "checkfile" under the key "HKEY_CURRENT_USER\Software\pdfMachine\Broadgun pdfMachine". The last part of the path is the printer name which in this example is the default printer name Broadgun pdfMachine. Set the string registry value to the client side filepath mapping required to access the file on the server. (e.g. \\server\c\x.txt)
 

4. Either reboot the client PC or stop and restart bgsmsnd.exe (bgsmsnd.exe is usually in c:\windows\system32\spool\drivers\32x86\3)

Now when the server file c:\tmp\x.txt is updated, the client bgsmsnd.exe notices (the checkfile registry val does this) and will load the pdf file on the client.

NOTE: You can choose to have the file automatically emailed by the client by setting the client option "Next Action" to "Launch default email client". If you want encryption with this option, enable it on the server, not the client.







On Windows 98, how do I fix "External Window Handler Error?"


This is an occasional problem on Windows 98 related to a known problem with acrobat reader. More . http://www.adobe.com/support/techdocs/2a086.htm
A solution is currently in development, in the interim try:
Rebooting your machine. Next time you logon things may be ok.
Opening the acrobat PDF reader (with no document open) prior to printing to pdfMachine.



How do I fix the "getTempBrowser CopyFile()" error when printing from IE?

The message can sometimes occur when printing from Internet Explorer in protected mode.

Make sure the pdfMachine toolbar is installed and enabled in Internet Explorer.
Make sure you use the pdfMachine toolbar icon in Internet Explorer to initiate the print to PDF. That way you should not get the error message.

The pdfMachine toolbar does several things, one is to workaround the problem you are getting. The other main thing it does is convert HTML hyerlinks into PDF hyperlinks.





How can I uninstall pdfMachine manually?

On Windows NT/2000/XP:

Exit all applications you are not using.
1. Run bgssetup.exe -uninstall

e.g. from the start menu button, select run, then enter:
C:\WINDOWS\system32\spool\drivers\w32x86\3\bgssetup.exe -uninstall

2. You may need to change the above path to match your system. If this works, you have successfully uninstalled.
Otherwise try; (be careful, don't go editing the registry unless you know what you are doing...)
1. Start a command line session e.g cmd.exe
2. Type "net stop spooler"
3. Type "regedit"
4. From within regedit - delete the following registry keys (and all subkeys):
HKEY_CURRENT_USER\Software\pdfMachine
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\PDF Port Monitor
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Printers\BroadGun pdfMachine

5. From the command line, type "net start spooler"
6. Re-attempt the install.

On Windows 95/98/ME:

Exit all applications you are not using
1. Run bgssetup.exe -uninstall
e.g. from the start menu button, select run, then enter:
bgssetup.exe -uninstall

If this succeeds, you have successfully uninstalled.
Otherwise try; (be careful, don't go editing the registry unless you know what you are doing...)
1. Start regedit.exe and delete the following keys and sub keys:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\PDF Port Monitor
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Printers\BroadGun pdfMachine
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows NT x86\Drivers\Version-2\BroadGun pdfMachine
2. Re-attempt the install.







Can I customize the pdfMachine install?

The downloadable file, pdfMachine.exe,  is a self extracting zip file.  If you unzip it you will notice a bunch of files, but the ones of interest are:

    bgssetup.exe - The setup program. This is automatically run by the self extracting zip to install the software.

    bgsconf.ini - The setup configuration file, loaded by bgssetup.exe.  This file is customizable in any text editor, e.g. notepad.

 

Install options in the bgsconf.ini file are:
LANG Can currently be EN(English), DE(German), FR(French), ES(Spanish), PL(Polish), PT(Portuguese), IT(Italian)
startMenuName Controls the name on the start menu
printer Name of the printer (defaults to BroadGun pdfMachine)
quiet Set to 1 to install without user interaction
isShared Set to 1 to share the printer on the network.
OfficeAddin Set to 1 to install the Microsoft Office addin toolbar
installerStartBgProcess Set to 0 to prevent bgsmsnd.exe being started during install. See more info here



After you have changed the bgsconf.ini file, to install the software run the bgssetup.exe program.







How do I edit the bgsconf.ini file in the pdfMachine.exe installer?

First read the above section, Can I customize the pdfMachine install

Here is how to repackage the pdfMachine.exe self extracting zip with new options:

- Open pdfMachine.exe in a zip program. eg Winzip, or 7zip.
- Extract the contents to directory of your choosing.
- Edit the bgsconf.ini
- Create a zip file of the new contents.
eg in the directory contains the extracted and edited files
zip ..\pdfmachine.zip *.*
- Create a new pdfMachine.exe using winzipse
eg in the directory containing the zip file:
winzipse has a limited command line capability so requires these parameters be put in a text file
create winzipse.txt containing pdfmachine.zip -st pdfMachine.exe -setup -i pdfMachn.ico -t setupdlg.txt -win32 -le -C .\bgssetup.exe
then run winzipse @winzipse.txt

You now have a new pdfMachine.exe







How do I create an installer for users without administrative privileges?

To install printers, the installer needs administrative privileges. This can be done using the runas command.
runas /user:Admin pdfMachine.exe
Then enter the Admin users password.
(runas does not allow the password to be specified as a command line parameter - see below for further information)

Unfortunately, the standard pdfMachine.exe generates an error because it starts a background process running as the Admin user.
To prevent this, you need to set installerStartBgProcess=0 in the bgsconf.ini file.

bgsmsnd.exe must be running (as the user) for the user to successfully print to pdfMachine.
When the runas command completes, you should then run the bgsmsnd.exe as the normal user.
(alternatively bgsmsnd.exe will be started automatically next time the user logs on)








How do I create an unattended installer for users without administrative privileges?

To use runas without having to manually enter the admin password, requires that you create a script to enter the password for you.

There are a few common ways to do this, some more secure than others:

scriptit - Microsoft's utility for building install scripts.
autoit - A free scripting utility - can produce compiled scripts as standalone executables.
Runas Professional - Can take password on command line but can also produce standalone exes with the password encrypted internally.


pdfMachine installation error message 126


Some users have reported an obscure "error 126" when installing pdfMachine. We have had a report that this can occur as a result of some other program incorrectly setting a registry type. The fix was:

1. Open regedit.exe

2. Navigate to :
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

3. Rename "Path" value to "Path.1" or some other temporary value. (Right click on value, select rename)

4. Create a new value called "Path" of type "Expandable String Value".
To do this, right click in regedit window, select "New-> Expandable String Value"

5. Copy the value of "Path.1" to "Path".

6. Make sure the Path value includes the directory:
%SystemRoot%\System32\Wbem

(see http://support.microsoft.com/default.aspx?scid=kb;EN-US;319114  for details )

6. You may have to reboot for the new setting to take effect. Once rebooted, run the installer again.

















How do I get Citrix "Published Applications" to work?


If you are using are using the "published application" feature of Citrix there are a few things you have to do to get pdfMachine to work.

You need to configure a start-up script or something that launches bgsmsnd.exe before the published app starts. Also, you will need to then configure your Citrix session to kill bgsmsnd.exe upon exit, otherwise it will hang around. You can do this by running bgsmsnd.exe again with the command line option -exit. e.g. bgsmsnd.exe -exit

bgsmsnd.exe is a pdfMachine background process that must be running under the same account as the application that is doing the printing. It is started at install and logon time. It is usually located C:\windows\system32\spool\drivers\w32x86\2\bgsmsnd.exe (or similar)

Check out the pdfMachine options. Under "General" , you can set the default save directory.
Under "Next Action" - you can change what happens after you do a print. e.g. if you don't want the default pdfMachine interface to pop up, you can set it to "Launch default pdfMachine viewer" which will most likely launch acrobat reader.








How do I get rid of the error "You do not have sufficient access to your machine to connect to the selected printer."?


When you are logged into a Terminal Server and you connect to a shared printer that is running on another machine the error "You do not have sufficient access to your machine to connect to the selected printer" may be displayed. This is because the "Prevent users from installing printer drivers" option is enabled by default in the local security settings.

On the server running Terminal Services:
  1. Click Start, point to Programs, click Administrative Tools, and then double-click Local Security Policy.
  2. Double-click Local Policies.
  3. Double-click Security Options.
  4. In the right pane, double-click Prevent users from installing printer drivers.
  5. Click Disabled, and then click OK.
  6. Close the Local Security Settings window.

It may then be necessary to reboot the server or to force an immediate policy refresh for the change to take effect.









How can I run a batch file in "Next Action" command line?


To specify a batch file or script to execute upon PDF generation, bring up the pdfMachine options and select 'Next Action/ Email' then set 'Next Action' to 'Execute command line'.

New limitations in Windows have made it so that batch files will only run if you pipe the output to another file.
For example, you can set the command line to "cmd /c c:\YourName.bat %s > c:\YourNameOut.txt".
The %s is substituted with the name of the pdf file produced, and any output from your batch file is sent to c:\YourNameOut.txt.

Alternatively, you can run other executables, including cscript.exe as shown in this cscript "Next Action" example.