1

我使用pdf2json生成了一个 json 文件;现在我想使用FlexpaperViewer在 html 4 中渲染它,但是当我尝试时,我得到一个“未捕获的类型错误:无法调用未定义的方法“替换”。

这是html:

<!DOCTYPE html/> 
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">   
    <head>  
        <title>FlexPaper</title>          
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
        <meta name="viewport" content="initial-scale=1,user-scalable=no,maximum-scale=1,width=device-width" /> 
        <style type="text/css" media="screen">  
            html, body    { height:100%; } 
            body { margin:0; padding:0; overflow:auto; }    
            #flashContent { display:none; } 
        </style>  
        <link href="../../FlexPaper/flexpaper.css" rel="stylesheet" type="text/css" /> 
        <script src="../../FlexPaper/jquery-1.10.2.js" type="text/javascript"></script> 
        <script src="../../FlexPaper/jquery.extensions.min.js" type="text/javascript"></script> 
        <script src="../../FlexPaper/flexpaper.js" type="text/javascript"></script> 
        <script src="../../FlexPaper/flexpaper_handlers.js" type="text/javascript"></script> 
        <script src="../../FlexPaper/flexpaper_handlers_debug.js" type="text/javascript"></script> 
        <script src="../../FlexPaper/FlexPaperViewer.js" type="text/javascript"></script> 
    </head> 
    <body> 
        <div id="documentViewer" class="flexpaper_viewer" style="position:absolute;left:10px;top:10px;width:770px;height:500px"></div> 

    <script type="text/javascript"> 
        $(document).ready(function () { 
            $('#documentViewer').FlexPaperViewer( 
              { config: { 
                  //DOC : escape(getDocumentUrl(startDocument)), 
                  JSONFile: "../../FlexPaper/paper.js", 
                  Scale: 0.6, 
                  ZoomTransition: 'easeOut', 
                  ZoomTime: 0.5, 
                  ZoomInterval: 0.1, 
                  FitPageOnLoad: true, 
                  FitWidthOnLoad: false, 
                  FullScreenAsMaxWindow: false, 
                  ProgressiveLoading: false, 
                  MinZoomSize: 0.2, 
                  MaxZoomSize: 5, 
                  SearchMatchAll: false, 
                  RenderingOrder: 'html,html5', 
                  ViewModeToolsVisible: true, 
                  ZoomToolsVisible: true, 
                  NavToolsVisible: true, 
                  CursorToolsVisible: true, 
                  SearchToolsVisible: true, 
                  key: '***', 
                  localeDirectory: "../../FlexPaper/locale/", 
                  localeChain: 'en_US' 
              } 
              } 
            ); 
        }); 
    </script> 


</body> 

你能帮我找出我做错了什么吗?提前致谢。

4

1 回答 1

1

在 Firefox 中,您会收到不同的错误:

TypeError: this.pageImagePattern is undefined

FlexPaper 的 HTML 版本似乎需要 PDF 和 JSON 文件来呈现。

因此,您还需要指定:

PDFFile: "../../sth",

这将使它正常工作。干杯! :)

于 2014-05-09T08:03:54.317 回答