国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
FlexPaper

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)載:

 

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 atAdobe'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>

國內(nèi)介紹該控件庫的先驅(qū):

http://wangcheng.javaeye.com/blog/549074

轉(zhuǎn)載其博客內(nèi)容:

Flex:使用FlexPaper顯示PDF文檔

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版本瀏覽你的文檔

  1. 下載并解壓出已經(jīng)編譯好的FlexPaper
  2. zip文件包含一個(gè)例子文件叫做FlexPaperViewer.html,它向你展示了需要傳給FlexPaper的基本參數(shù)
    1. var params = {   
    2. SwfFile : "Paper.swf",   
    3. Scale : 0.6   
    4. }   
    5. swfobject.embedSWF("FlexPaperViewer.swf","cb","500","500","9.0.0","js/swfobject/expressInstall.swf", params);   
    6.   
    7. //SwfFile參數(shù)是你想顯示的文件,Scale是0-1之間的數(shù),表示顯示的放大參數(shù)  
     
  3. 復(fù)制你創(chuàng)建出來的swf和PDF2SWF到解壓縮出的相同目錄
  4. 確定你添加了FlexPaperViewer.swf

三. 在Flex中使用FlexPaper

 

1. 下載FlexPaper SWC,添加到你的Flex項(xiàng)目libs中
2. 復(fù)制你用PDF2SWF創(chuàng)建的SWF到你的bin-debug目錄,如Paper3.swf,添加FlexPaper組件到你的flex代碼中

 

  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"    
  3.     layout="absolute"  
  4.     width="800" height="500"  
  5.     xmlns:flexpaper="com.devaldi.controls.flexpaper.*">  
  6.        
  7.     <flexpaper:FlexPaperViewer width="800" height="500"    
  8.         Scale="1" SwfFile="Paper3.swf" />  
  9.        
  10. </mx:Application>  

 

原文 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

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊舉報(bào)
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
FlexPaper - 在線文檔顯示組件 - 開源中國社區(qū)
FlexPaper 實(shí)現(xiàn)百度文庫式應(yīng)用
FlexPaper SWFTools 實(shí)現(xiàn)仿百度文庫及一些小問題
Java+FlexPaper+swfTools仿百度文庫文檔在線預(yù)覽系統(tǒng)設(shè)計(jì)與實(shí)現(xiàn)
網(wǎng)頁文檔在線瀏覽(仿百度文庫設(shè)計(jì))
php仿百度文庫,豆丁在線文檔(word,excel,ppt轉(zhuǎn)flash)
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服