Kbase P22533: How to print a PDF file from Progress -> using Acrobat Reader
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/24/2006 |
|
Status: Verified
GOAL:
How to print a PDF file from Progress.
GOAL:
How to use Acrobat Reader to print PDF files.
FIX:
The following example code can be used. It relies on using Acrobat Reader to print the .PDF for you, ensuring the file is handled correctly. It uses an (undocumented) parameter of the Acrobat Reader executable:
DEFINE VARIABLE cAcroRead AS CHARACTER NO-UNDO
INITIAL '"C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe" /t "%1" "%2" "%3" "%4"'.
/* The correct value for cAcroRead can be retrieved from registry key
HKEY_CLASSES_ROOT\AcroExch.Document\shell\printto\command
This is in fact the Windows Explorer shell extension used to print PDF files */
cAcroRead = REPLACE(cAcroRead,'%1','C:\Docs\start.pdf'). /* PDF file */
cAcroRead = REPLACE(cAcroRead,'%2','Insert Name Here'). /* Windows printer name */
cAcroRead = REPLACE(cAcroRead,'%3',''). /* Printer driver */
cAcroRead = REPLACE(cAcroRead,'%4',''). /* Printer port */
OS-COMMAND NO-CONSOLE VALUE(cAcroRead).
For Acrobat Reader 6.0, the command is:
"C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe" /p /h "%1"
Option meaning:
/s Opens Acrobat or adobe Reader, suppressing the splash screen
/o Opens Acrobat or adobe Reader, suppressing the open file dialog.
/h Opens Acrobat or Adobe Reader in a minimized window
/p pathname - Executes Adobe reader and displays the Print dialog box.
/t path "printername" "drivername" portname" - Initiates Adobe reader and prints a file, whose path must be fully specified, while suppressing the Print dialog box.
* printername - The name of the printer
* drivername - The printer driver's name, as it appears in the printer's properties.
* portname - The printer's port. portname cannot contain any "/" characters; it it does, output is routed to the default port for that printer.