无法阅读XRef流pdfworker.js

时间:2016-11-18 03:49:35

标签: javascript jquery pdf pdf-generation

我是java脚本的新手。我在控制台Invalid Xref Stream中收到错误。它来自pdf.worker.js ..为什么我们得到这个错误的任何线索?

$scope.loadPDF = function(path) {
            // /!\ Function modified from library in order to mamage error view on pdf display /!\
            console.log('loadPDF ', path);
            $scope.$parent.$parent.isPdfError = false;
            PDFJS.getDocument(path, null, null, $scope.documentProgress).then(function(_pdfDoc) {
                $scope.pdfDoc = _pdfDoc;
                $scope.renderPage($scope.pageNum, function(success) {
                    if ($scope.loadProgress) {
                        $scope.loadProgress({state: "finished", loaded: 0, total: 0});
                    }
                });
            }, function(message, exception) {
                console.log("PDF load error: " + message);
                $scope.$parent.$parent.isPdfError = true;
                $scope.$parent.$parent.$digest();
                if ($scope.loadProgress) {
                     $rootScope.completeProgress();
                    $scope.loadProgress({state: "error", loaded: 0, total: 0});
                }
            });
        };

0 个答案:

没有答案