diff --git a/web/viewer.css b/web/viewer.css index 70d659c3d..62ff3f2eb 100644 --- a/web/viewer.css +++ b/web/viewer.css @@ -1162,6 +1162,17 @@ canvas { font-size: 10px; } +#viewer.textLayer-visible .textLayer > div, +#viewer.textLayer-hover .textLayer > div:hover { + background-color: white; + color: black; +} + +#viewer.textLayer-shadow .textLayer > div { + background-color: rgba(255,255,255, .6); + color: black; +} + @page { margin: 0; } diff --git a/web/viewer.js b/web/viewer.js index 03766ab19..48bbf6eec 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -1802,8 +1802,19 @@ window.addEventListener('load', function webViewerLoad(evt) { mozL10n.language.code = locale; //#endif - if ('disableTextLayer' in hashParams) - PDFJS.disableTextLayer = (hashParams['disableTextLayer'] === 'true'); + if ('textLayer' in hashParams) { + switch (hashParams['textLayer']) { + case 'off': + PDFJS.disableTextLayer = true; + break; + case 'visible': + case 'shadow': + case 'hover': + var viewer = document.getElementById('viewer'); + viewer.classList.add('textLayer-' + hashParams['textLayer']); + break; + } + } //#if !(FIREFOX || MOZCENTRAL) if ('pdfBug' in hashParams) {