At 02:25 PM 10/5/2005, Damon Kaufman wrote:

Is there a way to launch (?) a PDF file to print without opening it in
Adobe Reader?

We have certain static PDF files that I would like to be able to print
without opening the page in Adobe, and then having the operator print
the page.


Damon,

Here's how:

Two techniques ...

01. Using the CHOOSE Command
02. Using the LoadFileName.RBL PLUGIN

Example 01 (Using the CHOOSE Command):

-- start
CLEAR VAR vPDFFileName,vMsg,vPrintYesNo,vPrintString,vQuotes
SET VAR vPDFFileName TEXT = NULL
SET VAR vMsg TEXT = NULL
SET VAR vPrintYesNo TEXT = NULL
SET VAR vPrintString TEXT = NULL
SET VAR vQuotes TEXT = (CVAL('QUOTES'))

CLS
CHOOSE vPDFFileName FROM #LFILES IN *.PDF +
CHKBOX 1 TITLE 'Select PDF File to Print' +
CAPTION ' R:Pick and Print PDF On Demand!' LINES 30 FORMATTED +
OPTION LIST_FONT_COLOR WHITE +
|LIST_BACK_COLOR TEAL +
|TITLE_FONT_COLOR RED +
|TITLE_BACK_COLOR WHITE +
|WINDOW_BACK_COLOR WHITE +
|TITLE_FONT_NAME VERDANA +
|TITLE_FONT_SIZE 14 +
|TITLE_BOLD ON +
|WINDOW_CAPTION +
|BUTTONS_BACK_COLOR WHITE +
|BUTTONS_SHOW_GLYPH ON

IF vPDFFileName IS NULL OR vPDFFileName = '[Esc]' THEN
   GOTO Done
ENDIF

SET VAR vMsg = +
((CHAR(013))+'File Name:'&.vPDFFileName+(CHAR(013))+(CHAR(013))+ +
'Would you like to Print?'+(CHAR(013)))

CLS
DIALOG .vMsg vPrintYesNo vEndKey YES +
CAPTION ' R:Pick and Print PDF On Demand!' +
ICON APP +
OPTION TITLE_FONT_COLOR BLACK +
|TITLE_BACK_COLOR WHITE +
|TRANSPARENCY 255 +
|WINDOW_BACK_COLOR WHITE +
|BUTTON_YES_CAPTION &Print +
|BUTTON_NO_CAPTION &Cancel +
|BUTTON_YES_COLOR GREEN +
|BUTTON_NO_COLOR RED +
|BUTTON_YES_FONT_COLOR WHITE +
|BUTTON_NO_FONT_COLOR WHITE

IF vPrintYesNo = 'No' OR vEndKey = '[Esc]' THEN
   GOTO Done
ENDIF

SET VAR vPrintString = +
(.vQuotes+'C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe|/p /h' +
&.vPDFFilename+.vQuotes)

-- If using Adobe Acrobat 6.0, change the directory to 6.0 in the string above

LAUNCH &vPrintString

LABEL Done
CLEAR VAR vPDFFileName,vMsg,vPrintYesNo,vPrintString,vQuotes
RETURN
-- end

Example 02 (Using the LoadFileName.RBL PLUGIN)

-- start
CLEAR VAR vPDFFileName,vMsg,vPrintYesNo,vPrintString,vQuotes
SET VAR vPDFFileName TEXT = NULL
SET VAR vMsg TEXT = NULL
SET VAR vPrintYesNo TEXT = NULL
SET VAR vPrintString TEXT = NULL
SET VAR vQuotes TEXT = (CVAL('QUOTES'))

CLS
PLUGINS LoadFileName.RBL vPDFFileName +
|FULLPATH ON +
|TITLE R:Pick and Print PDF - Select PDF File +
|FILTER Adobe PDF Files (*.pdf)#*.PDF
IF vPDFFileName IS NULL OR vPDFFileName = '[Esc]' THEN
   GOTO Done
ENDIF

SET VAR vMsg = +
((CHAR(013))+'File Name:'&.vPDFFileName+(CHAR(013))+(CHAR(013))+ +
'Would you like to Print?'+(CHAR(013)))

CLS
DIALOG .vMsg vPrintYesNo vEndKey YES +
CAPTION ' R:Pick and Print PDF On Demand!' +
ICON APP +
OPTION TITLE_FONT_COLOR BLACK +
|TITLE_BACK_COLOR WHITE +
|TRANSPARENCY 255 +
|WINDOW_BACK_COLOR WHITE +
|BUTTON_YES_CAPTION &Print +
|BUTTON_NO_CAPTION &Cancel +
|BUTTON_YES_COLOR GREEN +
|BUTTON_NO_COLOR RED +
|BUTTON_YES_FONT_COLOR WHITE +
|BUTTON_NO_FONT_COLOR WHITE
IF vPrintYesNo = 'No' OR vEndKey = '[Esc]' THEN
   GOTO Done
ENDIF

SET VAR vPrintString = +
(.vQuotes+'C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe|/p /h' +
&.vPDFFilename+.vQuotes)

-- If using Adobe Acrobat 6.0, change the directory to 6.0 in the string above

LAUNCH &vPrintString

LABEL Done
CLEAR VAR vPDFFileName,vMsg,vPrintYesNo,vPrintString,vQuotes
RETURN
-- end

Both techniques will print the PDF document directly to printer without
launching the Adobe Acrobat Reader and then clicking on the print button.

If you need more examples or the actual demo application, feel free to
contact me.

Enjoy and make sure to have fun!

Razzak.

Reply via email to