-
Christophe Feyte
- PowerBuilder
- Wednesday, 17 September 2025 08:18 AM UTC
Hello, we are using PB2022 Build 1892.
We are having a problem when we want to print an existing PDF.
We have a list of documents from which we can choose to print one or more at a time. After this initial print, we generate a PDF file of the printed documents. This way, if we want to reprint a document later, we don't have to go through all the code that generates the document's visual appearance, but can print the previously created PDF file directly.
To do this, we look in the registry (HKEY_CLASSES_ROOT\.pdf) for the program associated with PDF files and retrieve its command line. For example, with the latest version of Adobe Reader, it is located in: HKEY_CLASSES_ROOT\Acrobat.Document.DC\shell\Printto\command
The problem we encounter is that some users do not have any information entered in HKEY_CLASSES_ROOT\.pdf, whereas if they open a PDF directly, it launches Adobe Reader. The problem may exist with another PDF application.
We tried Roland Smith's RunAndWait object, which uses the ShellExecute command, but it only allows printing to the Windows default printer. This is a problem because a user may want to use a printer other than the default one.
We cannot change the version of PowerBuilder. Is there a way to use the printer selected by the user?
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.