ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

PlexPaper Practice

2019-07-31 10:06:56  阅读:273  来源: 互联网

标签:FlexPaper Practice SWF file PDF swf your PlexPaper


原文链接:http://www.cnblogs.com/yefengmeander/p/3497854.html

Introduction

FlexPaper is an open source light weight document viewer component designed to work together with libraries such as PDF2SWF, making it possible to display PDF files in Adobe Flex and other Flash based applications.

Making your document ready

To make it possible for your users to view your PDF documents without using Acrobat Reader, documents first needs to be converted to the SWF file format. There is a range of available converters, both commercial and free. The following example uses the open source tool SwfTools and can be automated if needed.

  1. Download and install SwfTools. All builds are available for download here.
  2. Convert your PDF to SWF. This is preferrably done from the command prompt. Make sure you set your options (Edit->Options) to "No viewer" if you are converting your PDF using the UI from SwfTools before exporting your PDF to SWF. This example converts a PDF file called "Paper3.pdf" to the output file "Paper3.swf":
    C:\SWFTools\pdf2swf.exe Paper3.pdf -o Paper3.swf
    Please see the wiki for more details about the conversion and the parameters that are currently recommended.
Viewing your document using the pre compiled flash version

The pre-compiled version of FlexPaper is most useful if you just want to use FlexPaper on any of your web pages.

  1. Download and extract the pre-compiled version of FlexPaper. All builds are available for download here.
  2. The zip file contains a sample file called "FlexPaperViewer.html" which shows you the basic parameters you need to pass to FlexPaper (SwfFile and Scale). Please see the wiki on Google Code for a complete list of available parameters.
  3. Copy the SWF you created with PDF2SWF to the same directory as your extracted files
  4. Upload everything to your web site and navigate to FlexPaperViewer.html in your favorite browser. If you on the other hand would like to run the application from a local directory rather than from a web server, then the application has to be added as trusted first. You can do that at Adobe's web site.
Using FlexPaper in Adobe Flex

Using the viewer in Adobe Flex is as easy a using the flash version.

  1. Download the FlexPaper SWC from Google Code and add the FlexPaper library to your Flex project.
  2. Copy the SWF you created with PDF2SWF to your bin-debug directory and add the FlexPaper component to your flex application as in the following example (update the SwfFile property on the component to point to your SWF file):
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="100%" height="100%" xmlns:fp="com.devaldi.controls.flexpaper.*">
        <fp:FlexPaperViewer width="520" height="450" Scale="0.6" SwfFile="Paper3.swf" /> </mx:Application>

 

1.解决搜索高亮问题:

搜索文字时可以搜素出相关的内容,但内容不能高亮,在查看官网的例子时发现是可以高亮的,仔细检查发现调用官方的API无误,应该可以排除代码的错误。 在仔细查看官网介绍“Large Documents”部分时有一行命令: C:\SWFTools\pdf2swf.exePaper.pdf-oPaper%.swf-f -T 9 -t -s storeallcharacters 刚开始看不懂,后来查看swftoos官网的文档时发现这几个参数大有讲究,大略翻译了一下:

-f 字体应该被嵌入,能够改善swf搜索

-T 9 设置转化的flash版本为9,提高swf的稳定性

-t 在每一帧时插入停止,提高swf的稳定性

-s storeallcharacters存储的文本文件中的所有字符信息,提高搜索能力 而上面命令行中的“%”则是将大文档转化为一页一页的,提高加载速度,是一个可选项。

按照上面命令行转化的结果,再次搜索时发现搜素的文字的确可以高亮。

转载于:https://www.cnblogs.com/yefengmeander/p/3497854.html

标签:FlexPaper,Practice,SWF,file,PDF,swf,your,PlexPaper
来源: https://blog.csdn.net/weixin_30247781/article/details/97889897

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有