您的位置:首页 > 其它

网页Adobe Reader ActiveX控件的说明文档

2015-12-11 15:47 330 查看

这阵子由于开发需要,重新研究了ADOBE READER的网页调用控件,所以搜索到了这篇文章,分享一下。

1. Adobe Reader ActiveX功能
使用 Acrobat Reader ActiveX控件可以在 Authorware应用程序中操作 PDF文件。

2. Adobe Reader AstiveX的属性

src:设置要打开的PDF文件名。、.

3. Adobe Reader ActiveX的常用方法(Methods)

□ gotOFirstPage:到第一页。

□ GotoLastPage:到最后一页。

□ GotoNextPape:到下一页。

□ GotopriciousPape:到上一页。

□ Print:打印文件。

□ PrintPages:打印指定页。带2个参数,第一个参数指定起始页,第一个参数指定结

束页。

□ Printwithdialog:打印文件前先显示打印机属性对话框。

□ SetCurrentpage:到指定页。带一个参数,该参数指定要跳转到的页数。

□ setshowscrollbars:设置是否显示Acrobat Reader的滚动条。带一个参数,该参数设为0时不显示滚动条,设为1时显示滚动条。

□ SetshowTOolbar:设置是否显示 Acrobat Reader的工具栏。带一个参数,该参数设为0时不显示,设为1时显示。

□ setView:设置显示效果。带一个参数,该参数是一个字符串,设为fit时将达到最佳显示效果。

□ SetZoom:设置文件的显示比例。带一个参数,该值为一个数值,比如设为90时,即为原窗口大小的90%。

4.Adobe Reader Active的应用实例

下面介绍如何在Authorware中使用这个控件来实现操作.PDF文件。

(1)新建一个文件,文件名为’Acrobat_Demo.a6p,打开文件属性设置对话框,根据屏幕

大小设置程序窗口大小。

(2)将一个计算图标拖拽到流程线上,命名为注册控件,在其中输入以下内容。

--控件的ClaSSID

COOID:="{CA8A9780280DllCFA24D、444553540000}"

--判断当前系统是否支持控件注册

if ActiveXInstalled()=-l then

--判断控件是否已安装

if AxtineXcontrolQuery(ConID)=0 then

Winpath:=getOSDirectory()

--拷贝文件到系统目录,wingX与winNT的系统目录分别system与sYStem32

CopyFile(FileLocation^“pdf.cox", Winpath^"system\\ pdf.ocx”)

COPyFile(FileLOCation^" pdf.OCx", Winpath^"system32\\ pdf.OCX")

--注册控件

ActiveXControlRegister(FileLocation^" pdf.cox")

end if

end if

(3)在注册控件图标下方单击鼠标。将粘贴指针移到此处,然后选择菜单命令Insert>Control>ActiveX,在弹出的 Select ActiveX Control对话框中选择 Acrobat Control for ActiveX控件,然后单击OK按钮,弹出ACrobat Reader控件的属性对话框,如图13.45所示。

设置好的依次单击确定按钮回到流程线上。把新加入的 Spirite Xtra图标改名为 acr。

(4)将一个计算图标拖拽到acr图标的下方,命名为打开文件,在其中输入以下内容。

--打开文件

SetspriteProperty(@"aCr",#cre,FileLoCation^ "1.pdP")

--显示工具栏

CallSPrite(@"acr",#Setshowtoolbar,l)

--按80%显示

CallSPrite(@"acr",#SetZoom,80)

英文说明

Adobe Acrobat ActiveX Control

"Adobe Acrobat Control for ActiveX"

"PDF.PdfCtrl.5"

"{CA8A9780-280D-11CF-A24D-444553540000}"




Properties

.src
: string

Get/Set the source PDF file.

Methods

.LoadFile
fileName:string

Load a new PDF file.

.setShowToolbar
On:Boolean

When the argument is false, the toolbar will be hidden. When the argument is true, the toolbar will be displayed.



.gotoFirstPage()

Positions the PDF document at the first page.

.gotoLastPage()

Positions the PDF document at the last page.

.gotoNextPage()

Moves to the next page in the PDF document.

.gotoPreviousPage()

Moves to the previous page in the PDF document.

.setCurrentPage
n:integer

Sets the current page of the PDF document to the supplied integer argument.

.goForwardStack()

.goBackwardStack()

.setPageMode
pageMode:string

Set the page mode to the supplied string argument.

.setLayoutMode
layoutMode:string

Set the layout mode to the supplied string argument.

.setNamedDest
namedDest:string

Set a named destination.

.Print()

Print the PDF document.

.printWithDialog()

Open the Print... dialog.

.setZoom
percent:float

Set the Zoom to the specified float value.

.setZoomScroll
percent:float left:float top:float

Set Zoom and Scroll to the specified float values.

.setView
viewMode:string

Set the view to the specified view mode.

.setViewScroll
viewMode:string offset:float

Set the view to the specified view mode and the offset to the specified float value.

.setViewRect
left:float top:float width:float height:float

Set the view to the rectangular area defined by the upper left corner, width and height values.

.printPages
from:integer to:integer

Print a range of pages.

.printPagesFit
from:integer to:integer shrinkToFit:boolean

Print a range of pages
with optional fitting.

.printAll()

Print all pages.

.printAllFit
shrinkToFit:Boolean

Print a all pages, shrinking them to fit the paper format when the supplied argument is set to true.

.setShowScrollbars
On:Boolean

Enable/Disable the Scrollbars display.





.AboutBox()

Open the About box. (Does not work at the moment)

Events

No events exposed by this control.


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: