加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

FlexPaper阅读器开发手册

发布时间:2020-12-15 03:55:46 所属栏目:百科 来源:网络整理
导读:转自:http://wujwmail.blog.163.com/blog/static/17055443320119532652421/ Flex阅读器(FlexPaper) Flex阅读器是一款由Devaldi开发的(Free)Flex程序库,它的功能是将服务器上的swf文件通过它生成的控件在浏览器上以类似PdfReader进行展示。可用它来制作精美

转自:http://wujwmail.blog.163.com/blog/static/17055443320119532652421/

Flex阅读器(FlexPaper)

Flex阅读器是一款由Devaldi开发的(Free)Flex程序库,它的功能是将服务器上的swf文件通过它生成的控件在浏览器上以类似PdfReader进行展示。可用它来制作精美的电子杂志和在线电子读物。 资源: ? ? ? ? 官方网址: http://flexpaper.devaldi.com/ ? ? ? ? 源码获取(SVN): http://flexpaper.googlecode.com/svn/trunk/ FlexPaper for FLEX4定制编译安装(二次开发) 建立一个名为的FlexPaper_SDK4库项目;先将源码目录FlexPaper下的所有文件(包括子目录)移入项目的FlexPaper_SDK4目录,然后将源码FlexPaper_SDK4的src目录考项目的同名目录;除去'启用警告'选项;附加的编译参数设置为:-locale zh_CN -source-path=locale/{locale} -keep-all-type-selectors=true 根据你的需要对源码进行修改,程序入口: FlexPaper_SDK4=>src=>com=>devaldi=>controls=>flexpaper=>FlexPaperViewer.mxml 在你的应用项目属性=>FLEX构建路径=>库路径中添加FlexPaper_SDK4/bin目录;这样FlexPaper_SDK4.swc库将直接导入到你的应用项目 对源码进行修改例子 ? ? 以下将去掉或修改原代码中所有与显示LOGO图片有关的代码? 去掉加载页的进度条的LOGO图片 ? ? 源文件:DupImage.as ? ? 找到语句:private var _skinImgl:Bitmap = new MenuIcons.LOGO_SMALL(); ? ? 替换为: private var _skinImgl:Bitmap = new Bitmap(); ? 去掉工具栏最右边[关于...]对话框的显示的按钮 源文件:FlexPaperViewer.mxml ? ? 将源码中所有的bttnInfo.visible = true; 替换成 bttnInfo.visible = false; ? 除去初始装载时的LOGO图标 ? ? 源文件:FlexPaperViewer.mxml ? ? 将控件lblProgress和spin1的初始属性分别加入: visible="false" ? 除去加载页的LOGO图标 源文件:FlexPaperViewer.mxml 将<fp:FlexPaperViewer_Base ...>的属性最后行加入creationComplete处理: <fp:FlexPaperViewer_Base xmlns:mx="http://www.adobe.com/2006/mxml" ? ? ? ? ? ? ? addedToStage="bindStageEvents(event)" ? ? ? ?xmlns:fp="com.devaldi.controls.flexpaper.*" ? ? ? ?xmlns:ct="com.devaldi.controls.*" ? ? ? ?xmlns:st="com.devaldi.skinning.*" ? ? ? ?creationComplete="initApp()"> 然后加入处理initApp()函数到<mx:Script>中 //---------------------------二次编程加入 ? ? ? ?public function initApp():void { ? ? ? ? ? ? ? paper1.removeElementAt(2); ? ? ? ?} 最后将源码中的函数papersLoadingHandler(event:Event)最后一行加上:paper1.removeElementAt(2); FlexPaper 直接用原始库安装及编程 ? ? ?注:如果没有特殊需要的话建议用原始库;本人发现Devaldi发布的开源代码库与原始库在性能上有所保留 在(http://flexpaper.devaldi.com/download/)下载FlexPaper SWC,将Flex4环境: FlexPaper_SDK4.swc(Flex3环境: FlexPaper.swc)拷贝到你的Flex项目libs中即可 一个简单的测试,复制你的SWF到你的bin-debug目录,准备一个swf 文件例如man.swf,添加FlexPaper组件到你的flex代码中 Flex代码 <?xml version="1.0" encoding="utf-8"?> ? ? ? ?<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" ? ? ? ?layout="absolute" ? ? ? ?width="800" height="500" ? ? ? ?xmlns:flexpaper="com.devaldi.controls.flexpaper.*"> ? ? ? ?<flexpaper:FlexPaperViewer width="800" height="500" ? ? ? ?Scale="1" SwfFile="man.swf" /> </mx:Application> 如果运行正常则安装成功! ? 使用技巧(参见后面的实例程序段的红色的代码部分) 以下 mybook为FlexPaperViewer 的ID;二次开发时可将以下句集加入到FlexPaperViewer.mxml初始化调用中将 mybook改为this即可 除去关于对话框 在初始化组件事件处理函数中加入: ? ? ? ?mybook.cnv_info.removeElement(mybook.bttnInfo); 除去打印控件图标   在初始化组件事件处理函数中加入 ? ? ? ?mybook._FlexPaperViewer_GradientImageButton1.visible=false; 也可以除去整个工具栏 ? ? ? ?mybook.removeElementAt(0); 除去LOGO图标 ? ? ? ?在初始化组件事件处理函数中且在文档加载处理函数中加入(removeElementAt(2)为LOGO组件) ? ? ? ?var A:Object=mybook.getChildAt(1); ? ? ? ?A.removeElementAt(2); 也可以写为(paper1为页面组件id): ? ? ? ?mybook.paper1.removeElementAt(2); 将工具栏的位置放入页面的底部 ? ? ? ?在初始化组件事件处理函数中加入 ? ? ? ?mybook.removeElement(mybook.paper1); ? ? ? ?mybook.addElementAt(mybook.paper1,0); ? 参数: (以下参数可用于FlexPaper) ? ? ? SwfFile(String) ? ? ? ?打开Swf文件 Scale(Number) ? ? ? ? ? ? ? 放大因子,是一个0以上的数(带小数 1 = 100%) 。 ZoomTransition(String) ? ? ? ?光学变焦过渡,默认值是eaSEOut,可取值: easenone,eaSEOut,linear,eaSEOutquad ZoomTime(Number) ? ? ? ?时间过渡让变焦达到新的放大因子,值为0或更大的数。 ZoomInterval(Number) ? ? ? ?区间的滑动缩放。放大因子缺省值是0.1。如同在工具栏上使用滑动条按钮的效果。 FitPageOnLoad(Boolean) ? ? ? ?(布尔) 适合初始页大小(依高度而定)的装载页。如同在工具栏上使用fit-page按钮的效果。 FitWidthOnLoad(Boolean) ? ? ? ?(布尔)适合初始页宽度大小的装载页。如同在工具栏上使用fit-width按钮的效果。 llocaleChain(String) ? ? ? ?设置语言。 ? ? ? ?目前支持以下语言: ? ? ? ? ? ? ? en_US(英语) ? ? ? ? ? ? ? fr_FR(法国) ? ? ? ? ? ? ? zh_CN(中国、简体) ? ? ? ? ? ? ? es_ES(西班牙) ? ? ? ? ? ? ? pt_BR(巴西葡萄牙语) ? ? ? ? ? ? ? ru_RU(俄罗斯) ? ? ? ? ? ? ? fi_FN芬兰 ? ? ? ? ? ? ? de_DE(德国) ? ? ? ? ? ? ? nl_NL(荷兰) ? ? ? ? ? ? ? tr_TR(土耳其) ? ? ? ? ? ? ? se_SE(瑞典) ? ? ? ? ? ? ? pt_PT(葡萄牙) ? ? ? ? ? ? ? el_EL(希腊) ? ? ? ? ? ? ? da_DN(丹麦) ? ? ? ? ? ? ? cz_CS(捷克) ? ? ? ? ? ? ? it_IT(意大利) ? ? ? ? ? ? ? pl_PL(波兰) ? ? ? ? ? ? ? pv_FN芬兰 ? ? ? ? ? ? ? hu_HU(匈牙利) FullScreenAsMaxWindow(Boolean) ? ? ? ?(布尔)以最大化方式打开一个新浏览器窗口。 ProgressiveLoading(Boolean) ? ? ? ?(布尔) 将视本地负荷情况逐步地下载显示文档,而不是下载完后再显示。至少Flash9 以上版本的SWF生成文档 MaxZoomSize(Number) ? ? ? ?(数值) 最大允许设置缩放等级 MinZoomSize(Number) ? ? ? ?(数值) 允许设置最小缩放等级 SearchMatchAll(Boolean) ? ? ? ?(布尔) 当被设置为真时,可执行搜索功能。 InitViewMode(String) ? ? ? ?(字符串) 设置启动视图模式。例如“Portrait”或“TwoPage”。 ViewModeToolsVisible(Boolean) ? ? ? ?(布尔)显示或隐藏视图模式与工具栏 ZoomToolsVisible(Boolean) ? ? ? ?(布尔) 从工具栏显示或隐藏变焦工具 NavToolsVisible(Boolean) ? ? ? ?(布尔)显示或隐藏导航工具 CursorToolsVisible(Boolean) ? ? ? ?(布尔) 显示或隐藏光标工具 SearchToolsVisible(Boolean) ? ? ? ?(布尔)显示或隐藏的搜索工具 ? 下面例子可以通过参数的使用预编译的flash版 var fp = new FlexPaperViewer( 'FlexPaperViewer','viewerPlaceHolder',{ ? ? ? ?config : { ? ? ? ? ? ? ? ? ? ? ?SwfFile : "Paper.swf",? ? ? ? ? ? ? ? ? ? ?Scale : 0.6,? ? ? ? ? ? ? ? ? ? ?ZoomTransition : "eaSEOut",? ? ? ? ? ? ? ? ? ? ?ZoomTime : 0.5,? ? ? ? ? ? ? ? ? ? ?ZoomInterval : 0.1,? ? ? ? ? ? ? ? ? ? ?FitPageOnLoad : false,? ? ? ? ? ? ? ? ? ? ?FitWidthOnLoad : false,? ? ? ? ? ? ? ? ? ? ?PrintEnabled : false,? ? ? ? ? ? ? ? ? ? ?FullScreenAsMaxWindow : true,? ? ? ? ? ? ? ? ? ? ?ProgressiveLoading : true,? ? ? ? ? ? ? ? ? ? ?MinZoomSize : 0.2,? ? ? ? ? ? ? ? ? ? ?MaxZoomSize : 5,? ? ? ? ? ? ? ? ? ? ?SearchMatchAll : false,? ? ? ? ? ? ? ? ? ? ?InitViewMode : 'Portrait',? ? ? ? ? ? ? ? ? ? ?ViewModeToolsVisible : true,? ? ? ? ? ? ? ? ? ? ?ZoomToolsVisible : true,? ? ? ? ? ? ? ? ? ? ?NavToolsVisible : true,? ? ? ? ? ? ? ? ? ? ?CursorToolsVisible : true,? ? ? ? ? ? ? ? ? ? ?SearchToolsVisible : true,? ? ? ? ? ? ? ? ? ? ?localeChain : "zh_CN" }}); 函数功能 .gotoPage(Number pageNumber) ? ? ? ?定位到你指定的页面 .fitWidth() ? ? ? ?适合宽度设置模式 .fitHeight() ? ? ? ?适合高度模式 .loadSwf(String swffile) ? ? ? ?载入一个新文件 .getCurrPage() ? ? ? ?载入一个页为当前页 .nextPage() ? ? ? ?下一页为当前页 .prevPage() ? ? ? ?移动到前一页 .Zoom(Number factor) ? ? ? ?变焦到指定的大小因子 .searchText(String text) ? ? ? ?搜索指定的文本 .switchMode(String mode) ? ? ? ?开启观赏模式。"Portrait","Two Page","Tile" // “肖像模式”、“两个页面”、“平铺” .printPaper() ? ? ? ?文件打印 .highlight(String url) ? ? ? ?高亮突出链接地址 .postSnapshot(String url) ? ? ? ?网页“快照”文档指定的url ? Events事件 onDocumentLoaded (no arguments) ? ? ? ?文档完成装载时 onDocumentLoadedError (String errormessage) ? ? ? ?文档完成装载错误发生时 onProgress (Number bytesloaded,Number bytestotal) ? ? ? ?文档装载时的过程中(装入的字节) onCurrentPageChanged (Number pagenumber) ? ? ? ?当当前页面发生改变时 onExternalLinkClicked (String link) ? ? ? ?当一个用户点击一个外部链接。 ? ? ? ?(Only works when supplying argument "-s linknameurl" in conversion with PDF2SWF) onDocumentPrinted (no arguments) ? ? ? ?当一个文件已完成打印时 服务器端的SWFTools 为了得到PlexPaper能加载的SWF文件,通常是将文件保存PDF文件后上传到服务器,而在服务器使用开源的SwfTools自动完成PDF到SWF转换,SWFTools 是一组用来处理 Flash 的 swf 文件的工具包,包括: 1. 合并工具 swfcombine 2. 抽取工具 swfextract 3. PDF/JPEG/PNG/AVI/TTF/WAV 到 SWF 的转换工具 :pdf2swf,jpeg2swf,png2swf,avi2swf,font2swf,and wav2swf 4. 文本解析工具 swfstrings 5. SWF 解析器 swfdump 6. SWF 读写库 rfxswflib ? 一个简单的将PDF文档转成SWF的用法: ? ? ? ?windows C:SWFToolspdf2swf 源文件.pdf -o 目标文件.swf -f -T 9 ? ? ? ?linux /usr/local/bin/pdf2swf $pdfFile -o $swfFile -f -T 9 -t -s storeallcharacters > /dev/null ? PDF2SWF转换文件参数 ? ? ? ?-h,--help 打印帮助短消息并退出 ? ? ? ?-V,--version 打印版本信息并退出 ? ? ? ?-o,--output file.swf 直接输出到文件。如果文件名为(file%.swf)输出每页为单独的文件。输出文件为:file[1-n].swf ? ? ? ?-p,--pages range 仅转换中的页面范围与范围例如 1-20 or 1,4,6,9-11 ? ? ? ?-P,--password password 使用密码破译加密的pdf文件。 ? ? ? ?-v,--verbose 显示详细信息。 ? ? ? ?-z,--zlib 使用flash 6 MX压缩和解压缩。 ? ? ? ?-i,--ignore 允许pdf2swf更改pdf的绘制顺序。 ? ? ? ?-j,--jpegquality quality 设置嵌入jpeg图片的质量,以质量。 0质量最差,100质量最佳。缺省值:85 ? ? ? ?-s,--set param=value 设置SWF编码器的特定参数。 ? ? ? ?-w,--samewindow 在转换为pdf的超链接时,不让链接打开一个新窗口。 ? ? ? ?-t,--stop 在每页中插入停止命令。 ? ? ? ?-T,--flashversion num 设置Flash版本。 ? ? ? ?-F,--fontdir directory 添加到搜索字体的路径目录。 ? ? ? ?-b,--defaultviewer 添加到搜索路径的字体目录。 ? ? ? ?-l,--defaultloader 一个标准的预加载器swf文件的链接加载。 ? ? ? ?-B,--viewer filename 查看器文件名以swf文件的链接。 ? ? ? ?-L,--preloader filename 预加载器文件名以swf文件的链接。 ? ? ? ?-q,--quiet 取消正常的消息,也可使用-qq取消警告。 ? ? ? ?-S,--shapes 不使用SWF的字体,但一切都存储为形状。 ? ? ? ?-f,--fonts 存储完整的字体在SWF。不减少使用的字符。 ? ? ? ?-G,--flatten 尽可能从文件中删除尽可能多的剪贴图层。 ? ? ? ?-I,--info 不做实际的转换,只显示在PDF中所有页面的列表。 ? ? ? ?-Q,--maxtime n 在n秒后,中止转换。仅Unix可用。 下面的4个常用的参数意义: ? ? ? ? ? ? ? -f 字体应该嵌入,提高可检索的文档 ? ? ? ?-T 设定目标flash版到9,提高稳定性 ? ? ? ?-t 每一帧之间插入一个停止,提高稳定性 ? ? ? ?-s storeallcharacters 存储文档中的所有字符文本的信息,提高了可搜索性 可选参数: ? ? ? ?-G14 使文件更小、更快的渲染 ? ? ? ?-s subpixels=1.5 subpixels = 1.5 在文档中调整图像分辨率。 ? ? ? ?在某些情况下应使用文件含有丰富的大的图像。 ? ? ? ?值(1.5),可以尝试要求质量档案。 ? ? ? ?请参阅http://wiki.swftools.org/index.php/Pdf2swfhttp://wiki.swftools.org/index.php/Pdf2swffor ? ? ? ?一个完整的PDF2SWF例子。 ? Linux下源码编译安装 SwfTools 安装swftools 及其编译支持库(jpegsrc,freetype) 1.安装jpegsrc.v7.tar.gz ? ? ? ?tar -zxvf jpegsrc.v7.tar.gz ? ? ? ?cd jpeg-7 ? ? ? ?./configure ? ? ? ?make ? ? ? ?make install 2.安装freetype-2.3.12.tar.gz ? ? ? ?tar -zxvf freetype-2.3.12.tar.gz ? ? ? ?cd freetype-2.3.12 ? ? ? ?./configure ? ? ? ?make ? ? ? ?make install 3.安装swftools-2011-01-23-1815.tar.gz ? ? ? ?tar -zxvf swftools-2011-01-23-1815.tar.gz ? ? ? ?cd swftools-2011-01-23-1815 ? ? ? ?ldconfig /usr/local/lib ? ? ? ?./configure ? ? ? ?make ? ? ? ?make install 原始Paper库的编程实例 (以下的应用实例仅为参考,如要真正运行服务器端需要本人的写的flexsys_class 类库支持的运行环境) XML定义文件: (sysbooks.xml) <?xml version="1.0" encoding="utf-8"?> <root> ? ? ? ?<title label="技术文档" key=""> ? ? ? ? ? ? ? <node label="服务器安装手册" key="serverMan.swf" pdfFile="服务器安装手册.pdf"/> ? ? ? ?</title> ? ? ? ?<title label="帮助文档" key=""> ? ? ? ? ? ? ? <node label="信贷档案操作说明" key="xdarMan.swf" pdfFile="信贷模块操作说明.pdf"/> ? ? ? ?</title> ? ? ? ?<title label="信贷资料" key=""> ? ? ? ? ? ? ? <node label="信贷资料管理系统实施方案" key="xdarMan1.swf" pdfFile="信贷资料管理系统实施方案.pdf"/> ? ? ? ?</title> </root> ? Flex程序: (sysbooks.mxml) <?xml version="1.0" encoding="utf-8"?> <mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009" ? ? ? ?xmlns:s="library://ns.adobe.com/flex/spark" ? ? ? ?xmlns:mx="library://ns.adobe.com/flex/mx" ? ? ? ?layout="absolute" width="100%" height="100%" ? ? ? ?mouseMove="vrule1_mouseMoveHandler(event)" ? ? ? ?mouseUp="vrule1_mouseUpHandler(event)" ? ? ? ?xmlns:flexpaper="com.devaldi.controls.flexpaper.*" ? ? ? ?creationComplete="initApp()"> <fx:Style source="flex_root.css" /> <fx:Script> <![CDATA[ ? ? ? ?import mx.collections.*; ? ? ? ?import mx.controls.Alert; ? ? ? ?import mx.events.DragEvent; ? ? ? ?import mx.events.ListEvent; ? ? ? ?import mx.managers.CursorManager; ? ? ? ?import mx.rpc.events.FaultEvent; ? ? ? ?import mx.rpc.events.ResultEvent; ? ? ? ?import mylib.*; ? ? ? ?public var Ocookies:MyCookies; ? ? ? ?[Bindable] ? ? ? ?public var http_server:String; ? ? ? ?[Bindable] ? ? ? ?private var userKey:String; ? ? ? ?[Bindable] ? ? ? ?private var xmldoc:XML; ? ? ? ?[Embed(source="images/resizeCursorH.gif")] ? ? ? ?public var Movecus:Class; ? ? ? ?private var cursorID:int; ? ? ? ?private var moveCursorFlag:Boolean=false; ? ? ? ?public var pdf_filename:String=""; ? ? ? ?public function initApp():void { ? ? ? ? ? ? ? Ocookies=this.parentApplication.Ocookies; ? ? ? ? ? ? ? http_server=Ocookies.ServerAddr; ? ? ? ? ? ? ? userKey=Ocookies.UserInfo.user_key; ? ? ? ? ? ? ? search_xml.send(); ? ? ? ?//FlexPaper初始化------------------------------------------------ ? ? ? ? ? ? ? //除去打印图标等图标 ? ? ? ? ? ? ? //mybook._FlexPaperViewer_GradientImageButton1.visible=false; ? ? ? ? ? ? ? var A:Object=mybook.getChildAt(0); ? ? ? ? ? ? ? A.removeElementAt(4); ? ? ? ? ? ? ? A.removeElementAt(3); ? ? ? ? ? ? ? A.removeElementAt(2); ? ? ? ? ? ? ? A.removeElementAt(1); ? ? ? ? ? ? ? A.removeElementAt(0); ? ? ? ? ? ? ? mybook.spin1.visible = false; ? ? ? ? ? ? ? mybook.lblProgress.visible = false; ? ? ? ? ? ? ? //关于对话框 ? ? ? ? ? ? ? mybook.cnv_info.removeElement(mybook.bttnInfo); ? ? ? ? ? ? ? //mybook.cnv_info.visible = false; ? ? ? ? ? ? ? //除去工具栏 ? ? ? ? ? ? ? //mybook.removeElementAt(0); ? ? ? ? ? ? ? //除去页面LOGO图标 ? ? ? ? ? ? ? mybook.paper1.removeElementAt(2); ? ? ? ? ? ? ? //工具栏放入底部 ? ? ? ? ? ? ? mybook.removeElement(mybook.paper1); ? ? ? ? ? ? ? mybook.addElementAt(mybook.paper1,0); ? ? ? ?//------------------------------------------------FlexPaper初始化 ? ? ? ?} ? ? ? ?//Cursor控制--------------------------------------------------------- ? ? ? ?protected function vrule1_mouSEOverHandler(event:MouseEvent):void{ ? ? ? ? ? ? ? cursorID = CursorManager.setCursor(Movecus,2,-10,-10); ? ? ? ?} ? ? ? ?protected function vrule1_mouSEOutHandler(event:MouseEvent):void{ ? ? ? ? ? ? ? CursorManager.removeCursor(cursorID); ? ? ? ?} ? ? ? ?protected function vrule1_mouseDownHandler(event:MouseEvent):void{ ? ? ? ? ? ? ? moveCursorFlag=true; ? ? ? ?} ? ? ? ?protected function vrule1_mouseUpHandler(event:MouseEvent):void{ ? ? ? ? ? ? ? moveCursorFlag=false; ? ? ? ?} ? ? ? ?protected function vrule1_mouseMoveHandler(event:MouseEvent):void{ ? ? ? ? ? ? ? if(!moveCursorFlag) return; ? ? ? ? ? ? ? myTree.width=event.stageX - 5; ? ? ? ? ? ? ? if(myTree.width<100){ ? ? ? ? ? ? ? ? ? ? ?myTree.width=100; ? ? ? ? ? ? ? ? ? ? ?moveCursorFlag=false; ? ? ? ? ? ? ? } ? ? ? ? ? ? ? if(myTree.width>500) myTree.width=500; ? ? ? ?} ? ? ? ?//---------------------------------------------------------Cursor控制 ? ? ? ?public function handleFault(event:FaultEvent):void{ ? ? ? ? ? ? ? Alert.show(event.fault.faultString,"通信错误"); ? ? ? ?} ? ? ? ?//装入 ? ? ? ?public function fsearch_xml(event:ResultEvent):void{ ? ? ? ? ? ? ? xmldoc=XML(event.result); ? ? ? ? ? ? ? myTree.validateNow(); ? ? ? ? ? ? ? for each(var item:XML in myTree.dataProvider) myTree.expandChildrenOf(item,true); ? ? ? ?} ? ? ? ?protected function myTree_changeHandler(event:ListEvent):void{ ? ? ? ? ? ? ? var data:Object=myTree.selectedItem; ? ? ? ? ? ? ? var sFile:String=data.@key; ? ? ? ? ? ? ? if(sFile!=""){ ? ? ? ? ? ? ? ? ? ? ?var pdfFile:String=data.@pdfFile; ? ? ? ? ? ? ? ? ? ? ?var sGet:String="?pdfFile="+pdfFile+"&swfFile="+sFile; ? ? ? ? ? ? ? ? ? ? ?mybook.SwfFile=http_server+"/flex_root/PHP/sys/getHelpPDF.php"+sGet; ? ? ? ? ? ? ? } ? ? ? ? ? ? ? //除去LOGO图标--------------------------- ? ? ? ? ? ? ? mybook.paper1.removeElementAt(2); ? ? ? ? ? ? ? //---------------------------除去LOGO图标 ? ? ? ?} ]]> </fx:Script> <fx:Declarations> ? ? ? ?<mx:HTTPService id="search_xml" ? ? ? ? ? ? ? url="{http_server}/flex_root/PHP/sys/sysbooks.xml" ? ? ? ? ? ? ? method="POST" ? ? ? ? ? ? ? showBusyCursor="true" ? ? ? ? ? ? ? result="fsearch_xml(event)" ? ? ? ? ? ? ? fault="handleFault(event)" ? ? ? ? ? ? ? resultFormat="e4x"> ? ? ? ?</mx:HTTPService> </fx:Declarations> <s:HGroup width="100%" height="100%" gap="0" x="0" y="0"> ? ? ? ?<mx:Tree id="myTree" width="180" height="100%" ? ? ? ? ? ? ? dataProvider="{xmldoc.title}" labelField="@label" change="myTree_changeHandler(event)"> ? ? ? ?</mx:Tree> ? ? ? ?<mx:VRule height="100%" tabEnabled="true" ? ? ? ? ? ? ? mouSEOver="vrule1_mouSEOverHandler(event)" ? ? ? ? ? ? ? mouSEOut="vrule1_mouSEOutHandler(event)" ? ? ? ? ? ? ? mouseDown="vrule1_mouseDownHandler(event)" /> ? ? ? ?<s:BorderContainer width="100%" height="100%" backgroundColor="#cccccc"> ? ? ? ? ? ? ? <flexpaper:FlexPaperViewer id="mybook" width="100%" height="100%" FitPageOnLoad="true" ? ? ? ? ? ? ? ? ? ? ?Scale="1" SwfFile="" /> ? ? ? ?</s:BorderContainer> </s:HGroup> </mx:Module> ? 服务器端程序: (getHelpPDF.php) <?php ? ? ? ?//获得PDF文件至swf文件的转换 ? ? ? ?function __autoload($class_name) { ? ? ? ? ? ? ? require_once($class_name . '.php'); ? ? ? ?} ? ? ? ?$oSYS=new flexsys_class(); ? ? ? ?$SysDataPath=$oSYS->BASE_data; ? ? ? ?$name=iconv("utf-8","gb2312//IGNORE",$_GET["pdfFile"]); ? ? ? ?$pdfFile=$SysDataPath."/pubftp/help/".$name; ? ? ? ?$swfFile=$SysDataPath."/pubftp/help/".$_GET["swfFile"]; ? ? ? ?if(!file_exists($pdfFile)) exit; ? ? ? ?$pdfTime=filemtime($pdfFile); ? ? ? ?if(!file_exists($swfFile)){ ? ? ? ? ? ? ? $swfTime=0; ? ? ? ?}else{ ? ? ? ? ? ? ? $swfTime=filemtime($swfFile); ? ? ? ?} ? ? ? ?if($pdfTime > $swfTime){ ? ? ? ? ? ? ? if(PHP_OS=="Linux"){ ? ? ? ? ? ? ? ? ? ? ?@system("/usr/local/bin/pdf2swf $pdfFile -o $swfFile -f -T 9 -t -s storeallcharacters > /dev/null"); ? ? ? ? ? ? ? }else{ ? ? ? ? ? ? ? ? ? ? ?@system('"c:/usr/web_root/pdf2swf.exe" $pdfFile -o $swfFile -f -T 9 -t -s storeallcharacters'); ? ? ? ? ? ? ? } ? ? ? ?} ? ? ? ?echo $oSYS->downWebFile($swfFile); ?>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读