Commit 212ddc11 authored by Robert Knight's avatar Robert Knight Committed by Nick Stenning

Support current versions of PDF.js (#134)

In current versions of PDF.js, the `RenderingStates` enum is no longer
exported as a global, and the export method appears to be dependent on
the build configuration.

Since `RenderingStates` is a trivial enum, this commit fixes the problem
by just reproducing it in `pdfjs-rendering-states.js`.
parent b32bd32b
......@@ -4,9 +4,9 @@ Annotator = require('annotator')
xpathRange = Annotator.Range
html = require('./html')
RenderingStates = require('../pdfjs-rendering-states')
{TextPositionAnchor, TextQuoteAnchor} = require('./types')
# Caches for performance
pageTextCache = {}
quotePositionCache = {}
......
'use strict';
/**
* Enum values for page rendering states (IRenderableView#renderingState)
* in PDF.js. Taken from web/pdf_rendering_queue.js in the PDF.js library.
*
* Reproduced here because this enum is not exported consistently across
* different versions of PDF.js
*/
var RenderingStates = {
INITIAL: 0,
RUNNING: 1,
PAUSED: 2,
FINISHED: 3,
};
module.exports = RenderingStates;
extend = require('extend')
Annotator = require('annotator')
RenderingStates = require('../pdfjs-rendering-states')
module.exports = class PDF extends Annotator.Plugin
documentLoaded: null
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment