2016-06-21 19 views
2

我在尋找一個Javascript庫,它可以顯示一個PDF文件作爲翻頁書,,無需任何預處理
(我們已經有很多PDF文件存儲並可以通過下載進行訪問,我們現在想要通過翻頁外觀將其展示在更多「用戶友好型」方式中,但我們不希望要全部轉換爲動畫書...)用於將PDF文件顯示爲翻書的Javascript庫?

喜歡的東西:rendering the HTML page in browser > processing the input PDF bytes > displaying them as HTML5 flipbook...

你會怎麼做這個任何想法?

NB:希望是不夠清楚......

回答

3

我希望你以後類似this one

var flipBook; 

jQuery(document).ready(function() { 

    //easiest with default settings 
    flipBook = $("#flipbookContainer").flipBook('example-assets/books/alice.pdf'); 

}); 

或者,您可以根據需要通過選擇變量自定義設置

var flipBook; 

jQuery(document).ready(function() { 

    //make sure this file is hosted in localhost or any other server 
    var pdf = 'example-assets/books/alice.pdf'; 

    //these are extra settings 
    var options = { 
     webgl:false, 
     height: 400, 
     duration: 800, 

     autoEnableOutline:true //auto open the outline/bookmarks tab 
    }; 

    /** 
    * outline is basically a array of json object as: 
    * {title:"title to appear",dest:"url as string or page as number",items:[]} 
    * items is the same process again array of json objects 
    */ 
    options.outline = [ 
     {title: "Page 1", dest: 1}, 
     {title: "Page 2", dest:2}, 
     {title: "StackOverflow", dest: "https://stackoverflow.com/",items:[ 
      {title:"My Profile",dest :"https://stackoverflow.com/users/6687403/deepak-ghimire"}, 
      {title:"Page 3",dest:3} 
     ]} 
    ]; 


    flipBook = $("#flipbookContainer").flipBook(pdf, options); 
}); 

希望它有幫助。

+0

是免費還是付費? – kritikaTalwar

+0

不,它不是免費的..但看起來值得[評論](https://codecanyon.net/item/dflip-flipbook-jquery-plugin/reviews/15834127) –