http://www.cnblogs.com/wuhenke/archive/2010/03/16/1686885.html
想想自己先前搞PDF轉(zhuǎn)SWF,然后在線瀏覽功能時(shí),實(shí)在是費(fèi)了不少精力。后來不斷發(fā)現(xiàn)實(shí)現(xiàn)類似功能的網(wǎng)站:http://www.doc88.com/ 和 http://www.docin.com/ 雖然他們做的都比我起初做的好,但他們都是公司實(shí)力支撐,依靠的也是那種盈利模式。
自己的也在逐步完善和改進(jìn)中,下面是我項(xiàng)目中的最終版:
一直希望在項(xiàng)目結(jié)束后,分享我的代碼和心得。前天碰巧看到有外國網(wǎng)友,將該功能封裝成SWC,實(shí)現(xiàn)技術(shù)路線都是相同的,現(xiàn)在大家可以學(xué)習(xí)一下,很方便地實(shí)現(xiàn)自己的PDF在線瀏覽功能了。(功能還不錯(cuò),但有待提高!如下:)
網(wǎng)站地址:
http://flexpaper.devaldi.com/index.php
介紹轉(zhuǎn)載:
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.
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.
C:\SWFTools\pdf2swf.exe Paper3.pdf -o Paper3.swfPlease see the wiki for more details about the conversion and the parameters that are currently recommended.
The pre-compiled version of FlexPaper is most useful if you just want to use FlexPaper on any of your web pages.
Using the viewer in Adobe Flex is as easy a using the flash version.
<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>
國內(nèi)介紹該控件庫的先驅(qū):
http://wangcheng.javaeye.com/blog/549074
轉(zhuǎn)載其博客內(nèi)容:
FlexPaper是一個(gè)開源的輕量級(jí)文檔顯示組件,被設(shè)計(jì)用來與PDF2SWF一起使用,使在Flex中顯示PDF成為可能。它可以被當(dāng)做Flex的library來使用。
一. 使用PDF2SWF準(zhǔn)備好你的文檔
首先要將PDF轉(zhuǎn)成SWF,這步可以使用開源的SwfTools自動(dòng)完成
1.下載安裝 SwfTools,當(dāng)前最新版本是0.9
2. 轉(zhuǎn)換PDF到SWF,可以通過命令行的方式,例如將Paper3.pdf轉(zhuǎn)換成Paper3.swf
C:\SWFTools\pdf2swf Paper3.pdf -o Paper3.swf
二. 使用已經(jīng)編譯好的FlexPaper的flash版本瀏覽你的文檔
三. 在Flex中使用FlexPaper
1. 下載FlexPaper SWC,添加到你的Flex項(xiàng)目libs中
2. 復(fù)制你用PDF2SWF創(chuàng)建的SWF到你的bin-debug目錄,如Paper3.swf,添加FlexPaper組件到你的flex代碼中
原文 http://www.devaldi.com/?page_id=260
SwfTools http://www.swftools.org/download.html
flexpaper http://code.google.com/p/flexpaper/
另外附 我推薦的參考資料網(wǎng)址:
http://wiki.swftools.org/index.php/Main_Page#SWF_API_Documentation
http://wiki.swftools.org/index.php/Pdf2swf
http://wiki.swftools.org/index.php/How_do_I_create_a_AVM2_compatible_SWF%3F
http://wiki.swftools.org/index.php/How_do_I_highlight_text_in_the_SWF%3F
聯(lián)系客服