mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Replace the disableTextLayer
and enhanceTextSelection
options/preferences with a single textLayerMode
option/preference
Rather than having two different (but connected) options for the textLayer, I think that it makes sense to try and unify this. For example: currently if `disableTextLayer === true`, then the value of `enhanceTextSelection` is simply ignored. Since PDF.js version `2.0` already won't be backwards compatible in lots of ways, I don't think that we need to worry about migrating existing preferences here.
This commit is contained in:
parent
3a6f6d23d6
commit
a1cfa5f4d7
7 changed files with 46 additions and 41 deletions
|
@ -37,6 +37,12 @@ const RendererType = {
|
|||
SVG: 'svg',
|
||||
};
|
||||
|
||||
const TextLayerMode = {
|
||||
DISABLE: 0,
|
||||
ENABLE: 1,
|
||||
ENABLE_ENHANCE: 2,
|
||||
};
|
||||
|
||||
// Replaces {{arguments}} with their values.
|
||||
function formatL10nValue(text, args) {
|
||||
if (!args) {
|
||||
|
@ -87,13 +93,6 @@ PDFJS.maxCanvasPixels = (PDFJS.maxCanvasPixels === undefined ?
|
|||
PDFJS.disableHistory = (PDFJS.disableHistory === undefined ?
|
||||
false : PDFJS.disableHistory);
|
||||
|
||||
/**
|
||||
* Disables creation of the text layer that used for text selection and search.
|
||||
* @var {boolean}
|
||||
*/
|
||||
PDFJS.disableTextLayer = (PDFJS.disableTextLayer === undefined ?
|
||||
false : PDFJS.disableTextLayer);
|
||||
|
||||
if (typeof PDFJSDev === 'undefined' ||
|
||||
!PDFJSDev.test('FIREFOX || MOZCENTRAL')) {
|
||||
/**
|
||||
|
@ -669,6 +668,7 @@ export {
|
|||
cloneObj,
|
||||
PresentationModeState,
|
||||
RendererType,
|
||||
TextLayerMode,
|
||||
mozL10n,
|
||||
NullL10n,
|
||||
EventBus,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue