Problem:
This sample Dialog System application loads a PDF file in a Dialog System screenset and calls differents methods of the ACROBAT READER ActiveX control to action on this activeX
Resolution:
1) For further details, please refer to Net Express documentation, mainly:
Bookshelf Net Express 4.0
http://supportline.microfocus.com/documentation/books/nx40/nx40indx.htm
Dialog System Guide
http://supportline.microfocus.com/documentation/books/nx40/dspubb.htm
....
Chapter 22: Tutorial - Adding an ActiveX Control
...
2) For further details, please refer to ACROBAT READER ActiveX control's documentation:
look, in the .ZIP attached, the files *.PDF which document the ACROBAT READER ActiveX control
====================================
3) Paste of the COBOL Code managing the ActiveX control--> file PDFOCX.cbl
The file typelib.cpy, contained in .ZIP, attached was generated by the Type Library Assistant of Net Express ( Toolbar menu->Tools->TypeLibrary assistant
...
PROCEDURE DIVISION USING DSC-Control-Block
Data-Block
.
invoke olesup "setDispatchType" using by value 1
MOVE LENGTH OF Call-Function TO Function-Length
CALL "CBL_TOUPPER" USING Call-Function
BY VALUE Function-Length
EVALUATE Call-Function
WHEN "EXAMPLE-FUNCTION"
*> PERFORM Do-Example-Function
CONTINUE
WHEN "GETSRC"
invoke PDFPdfCtrl6 "getsrc" returning src
display "Method: getstc: returned: " src
WHEN "LOADFILE"
move low-value to src
invoke PDFPdfCtrl6 "setsrc" using src
if PdftoLoad = spaces
or PdftoLoad(1:1) = low-value
or PdftoLoad( (length of PdftoLoad) : 1 ) = low-value
perform dogetcurentDIR
string directory-name(1:i)
"\\"
pdfName
into src
else
if PdftoLoad(2:1) = ":"
move PdftoLoad to src
else
perform dogetcurentDIR
string directory-name(1:i)
"\\"
PdftoLoad
into src
end-if
end-if
display "Method: LoadFile: passing " src
invoke PDFPdfCtrl6 "LoadFile" using src
returning zBOOL
display "Method: LoadFile: returned " zBOOL
WHEN "GOTONEXTPAGE"
invoke PDFPdfCtrl6 "gotoNextPage"
WHEN "GOTOPREVIOUSPAGE"
invoke PDFPdfCtrl6 "gotoPreviousPage"
WHEN "GOTOLASTPAGE"
invoke PDFPdfCtrl6 "gotoLastPage"
WHEN "GOTOFIRSTPAGE"
invoke PDFPdfCtrl6 "gotoFirstPage"
WHEN "PRINT"
invoke PDFPdfCtrl6 "Print"
WHEN "SETSHOWTOOLBAROFF"
invoke olesup "setDispatchType" using by value 0
invoke PDFPdfCtrl6 "setShowToolbar" using by value 0
WHEN "SETSHOWTOOLBARON"
invoke olesup "setDispatchType" using by value 0
invoke PDFPdfCtrl6 "setShowToolbar" using by value 1
WHEN "SETSHOWSCROLLBARSON"
invoke olesup "setDispatchType" using by value 0
invoke PDFPdfCtrl6 "setShowScrollBars" using by value 1
WHEN "SETSHOWSCROLLBARSOFF"
invoke olesup "setDispatchType" using by value 0
invoke PDFPdfCtrl6 "setShowScrollBars" using by value 0
WHEN "SETZOOM"
move ZOOMpercent to percent
invoke olesup "setDispatchType" using by value 0
invoke PDFPdfCtrl6 "setZoom" using percent
WHEN "SETVIEW"
invoke olesup "setDispatchType" using by value 0
invoke PDFPdfCtrl6 "setView" using IO-text-buffer
WHEN "SETPAGEMODE"
invoke olesup "setDispatchType" using by value 0
invoke PDFPdfCtrl6 "setPageMode" using IO-text-buffer
WHEN "ABOUTBOX"
invoke PDFPdfCtrl6 "AboutBox"
WHEN OTHER
DISPLAY Invalid-Function, " ", Call-Function
GO TO ActiveX-Program-Exit
END-EVALUATE.
ActiveX-Program-Exit.
EXIT PROGRAM.
...