Search code examples
ruby-on-rails-3flashswfobjectflexpaperpdf2swf

flexpaper default two page view settings


I am using flexpage along with pdf2swf to generate swf for my pdf files and showing it in my page.

Here is the setting i have used

<script type="text/javascript">
   highlightPageMenuLink();
  var swfVersionStr = "10.0.0";  // For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. 
    var xiSwfUrlStr = "playerProductInstall.swf"; // To use express install, set to playerProductInstall.swf, otherwise the empty string.  
    var flashvars = { 
      SwfFile : escape("<%= current_user.books.first.name%>.swf"),
        Scale : 0.6, 
        ZoomTransition : "easeOut",
        ZoomTime : 0.5,
      ZoomInterval : 0.1,
      FitPageOnLoad : false,
      FitWidthOnLoad : true,
      PrintEnabled : false,
      FullScreenAsMaxWindow : false,
      ProgressiveLoading : true,
      PrintToolsVisible : false,
      ViewModeToolsVisible : true,
      ZoomToolsVisible : true,
      FullScreenVisible : true,
      NavToolsVisible : true,
      CursorToolsVisible : true,
      SearchToolsVisible : false,
      localeChain: "en_US"
    };

    var params = {}
    params.quality = "high";
    params.bgcolor = "#ffffff";
    params.allowscriptaccess = "sameDomain";
    params.allowfullscreen = "true";
    var attributes = {};
    attributes.id = "FlexPaperViewer";
    attributes.name = "FlexPaperViewer";
    swfobject.embedSWF("FlexPaperViewer.swf", "flashContent", "650", "605", swfVersionStr, xiSwfUrlStr, flashvars, params, attributes);
    swfobject.createCSS("#flashContent", "display:block;text-align:left;");
</script>

ViewModeToolsVisible is set to true , with this I can see options to view pages in single page mode , two page mode and thumb mode. How to make two page view mode my default ?

Thanks.


Solution

  • Got the way to show two page view by default. we can just insert a call in flexpaper_flash.js

    function onDocumentLoaded(totalPages){
    getDocViewer().switchMode('TwoPage');}
    

    But then I was having a problem ,it was loading in single page mode first and then was converting the view to two page mode . Then I had to change

    ProgressiveLoading : true

    to

    ProgressiveLoading : false