[api-major] Completely remove the global PDFJS
object
This commit is contained in:
parent
4b4fcecf70
commit
b8606abbc1
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
PDFJS.GlobalWorkerOptions.workerSrc =
|
pdfjsDistBuildPdf.GlobalWorkerOptions.workerSrc =
|
||||||
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
||||||
|
|
||||||
var DEFAULT_URL = '../../test/pdfs/f1040.pdf';
|
var DEFAULT_URL = '../../test/pdfs/f1040.pdf';
|
||||||
@ -24,7 +24,7 @@ var DEFAULT_SCALE = 1.0;
|
|||||||
var container = document.getElementById('pageContainer');
|
var container = document.getElementById('pageContainer');
|
||||||
|
|
||||||
// Fetch the PDF document from the URL using promises.
|
// Fetch the PDF document from the URL using promises.
|
||||||
PDFJS.getDocument(DEFAULT_URL).then(function (doc) {
|
pdfjsDistBuildPdf.getDocument(DEFAULT_URL).then(function (doc) {
|
||||||
// Use a promise to fetch and render the next page.
|
// Use a promise to fetch and render the next page.
|
||||||
var promise = Promise.resolve();
|
var promise = Promise.resolve();
|
||||||
|
|
||||||
@ -32,12 +32,12 @@ PDFJS.getDocument(DEFAULT_URL).then(function (doc) {
|
|||||||
promise = promise.then(function (pageNum) {
|
promise = promise.then(function (pageNum) {
|
||||||
return doc.getPage(pageNum).then(function (pdfPage) {
|
return doc.getPage(pageNum).then(function (pdfPage) {
|
||||||
// Create the page view.
|
// Create the page view.
|
||||||
var pdfPageView = new PDFJS.PDFPageView({
|
var pdfPageView = new pdfjsDistWebPdfViewer.PDFPageView({
|
||||||
container: container,
|
container: container,
|
||||||
id: pageNum,
|
id: pageNum,
|
||||||
scale: DEFAULT_SCALE,
|
scale: DEFAULT_SCALE,
|
||||||
defaultViewport: pdfPage.getViewport(DEFAULT_SCALE),
|
defaultViewport: pdfPage.getViewport(DEFAULT_SCALE),
|
||||||
annotationLayerFactory: new PDFJS.DefaultAnnotationLayerFactory(),
|
annotationLayerFactory: new pdfjsDistWebPdfViewer.DefaultAnnotationLayerFactory(),
|
||||||
renderInteractiveForms: true,
|
renderInteractiveForms: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -3,16 +3,16 @@
|
|||||||
|
|
||||||
// Hello world example for browserify.
|
// Hello world example for browserify.
|
||||||
|
|
||||||
require('pdfjs-dist');
|
var pdfjsLib = require('pdfjs-dist');
|
||||||
|
|
||||||
var pdfPath = '../helloworld/helloworld.pdf';
|
var pdfPath = '../helloworld/helloworld.pdf';
|
||||||
|
|
||||||
// Setting worker path to worker bundle.
|
// Setting worker path to worker bundle.
|
||||||
PDFJS.GlobalWorkerOptions.workerSrc =
|
pdfjsLib.GlobalWorkerOptions.workerSrc =
|
||||||
'../../build/browserify/pdf.worker.bundle.js';
|
'../../build/browserify/pdf.worker.bundle.js';
|
||||||
|
|
||||||
// Loading a document.
|
// Loading a document.
|
||||||
var loadingTask = PDFJS.getDocument(pdfPath);
|
var loadingTask = pdfjsLib.getDocument(pdfPath);
|
||||||
loadingTask.promise.then(function (pdfDocument) {
|
loadingTask.promise.then(function (pdfDocument) {
|
||||||
// Request a first page
|
// Request a first page
|
||||||
return pdfDocument.getPage(1).then(function (pdfPage) {
|
return pdfDocument.getPage(1).then(function (pdfPage) {
|
||||||
|
@ -15,14 +15,14 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
if (!PDFJS.PDFPageView || !PDFJS.getDocument) {
|
if (!pdfjsDistBuildPdf.getDocument || !pdfjsDistWebPdfViewer.PDFPageView) {
|
||||||
alert('Please build the pdfjs-dist library using\n' +
|
alert('Please build the pdfjs-dist library using\n' +
|
||||||
' `gulp dist-install`');
|
' `gulp dist-install`');
|
||||||
}
|
}
|
||||||
|
|
||||||
// The workerSrc property shall be specified.
|
// The workerSrc property shall be specified.
|
||||||
//
|
//
|
||||||
PDFJS.GlobalWorkerOptions.workerSrc =
|
pdfjsDistBuildPdf.GlobalWorkerOptions.workerSrc =
|
||||||
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
||||||
|
|
||||||
// Some PDFs need external cmaps.
|
// Some PDFs need external cmaps.
|
||||||
@ -37,7 +37,7 @@ var SCALE = 1.0;
|
|||||||
var container = document.getElementById('pageContainer');
|
var container = document.getElementById('pageContainer');
|
||||||
|
|
||||||
// Loading document.
|
// Loading document.
|
||||||
PDFJS.getDocument({
|
pdfjsDistBuildPdf.getDocument({
|
||||||
url: DEFAULT_URL,
|
url: DEFAULT_URL,
|
||||||
cMapUrl: CMAP_URL,
|
cMapUrl: CMAP_URL,
|
||||||
cMapPacked: CMAP_PACKED,
|
cMapPacked: CMAP_PACKED,
|
||||||
@ -45,14 +45,14 @@ PDFJS.getDocument({
|
|||||||
// Document loaded, retrieving the page.
|
// Document loaded, retrieving the page.
|
||||||
return pdfDocument.getPage(PAGE_TO_VIEW).then(function (pdfPage) {
|
return pdfDocument.getPage(PAGE_TO_VIEW).then(function (pdfPage) {
|
||||||
// Creating the page view with default parameters.
|
// Creating the page view with default parameters.
|
||||||
var pdfPageView = new PDFJS.PDFPageView({
|
var pdfPageView = new pdfjsDistWebPdfViewer.PDFPageView({
|
||||||
container: container,
|
container: container,
|
||||||
id: PAGE_TO_VIEW,
|
id: PAGE_TO_VIEW,
|
||||||
scale: SCALE,
|
scale: SCALE,
|
||||||
defaultViewport: pdfPage.getViewport(SCALE),
|
defaultViewport: pdfPage.getViewport(SCALE),
|
||||||
// We can enable text/annotations layers, if needed
|
// We can enable text/annotations layers, if needed
|
||||||
textLayerFactory: new PDFJS.DefaultTextLayerFactory(),
|
textLayerFactory: new pdfjsDistWebPdfViewer.DefaultTextLayerFactory(),
|
||||||
annotationLayerFactory: new PDFJS.DefaultAnnotationLayerFactory()
|
annotationLayerFactory: new pdfjsDistWebPdfViewer.DefaultAnnotationLayerFactory(),
|
||||||
});
|
});
|
||||||
// Associates the actual page with the view, and drawing it
|
// Associates the actual page with the view, and drawing it
|
||||||
pdfPageView.setPdfPage(pdfPage);
|
pdfPageView.setPdfPage(pdfPage);
|
||||||
|
@ -15,14 +15,14 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
if (!PDFJS.PDFViewer || !PDFJS.getDocument) {
|
if (!pdfjsDistBuildPdf.getDocument || !pdfjsDistWebPdfViewer.PDFViewer) {
|
||||||
alert('Please build the pdfjs-dist library using\n' +
|
alert('Please build the pdfjs-dist library using\n' +
|
||||||
' `gulp dist-install`');
|
' `gulp dist-install`');
|
||||||
}
|
}
|
||||||
|
|
||||||
// The workerSrc property shall be specified.
|
// The workerSrc property shall be specified.
|
||||||
//
|
//
|
||||||
PDFJS.GlobalWorkerOptions.workerSrc =
|
pdfjsDistBuildPdf.GlobalWorkerOptions.workerSrc =
|
||||||
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
||||||
|
|
||||||
// Some PDFs need external cmaps.
|
// Some PDFs need external cmaps.
|
||||||
@ -36,17 +36,17 @@ var SEARCH_FOR = ''; // try 'Mozilla';
|
|||||||
var container = document.getElementById('viewerContainer');
|
var container = document.getElementById('viewerContainer');
|
||||||
|
|
||||||
// (Optionally) enable hyperlinks within PDF files.
|
// (Optionally) enable hyperlinks within PDF files.
|
||||||
var pdfLinkService = new PDFJS.PDFLinkService();
|
var pdfLinkService = new pdfjsDistWebPdfViewer.PDFLinkService();
|
||||||
|
|
||||||
var pdfViewer = new PDFJS.PDFViewer({
|
var pdfViewer = new pdfjsDistWebPdfViewer.PDFViewer({
|
||||||
container: container,
|
container: container,
|
||||||
linkService: pdfLinkService,
|
linkService: pdfLinkService,
|
||||||
});
|
});
|
||||||
pdfLinkService.setViewer(pdfViewer);
|
pdfLinkService.setViewer(pdfViewer);
|
||||||
|
|
||||||
// (Optionally) enable find controller.
|
// (Optionally) enable find controller.
|
||||||
var pdfFindController = new PDFJS.PDFFindController({
|
var pdfFindController = new pdfjsDistWebPdfViewer.PDFFindController({
|
||||||
pdfViewer: pdfViewer
|
pdfViewer: pdfViewer,
|
||||||
});
|
});
|
||||||
pdfViewer.setFindController(pdfFindController);
|
pdfViewer.setFindController(pdfFindController);
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ container.addEventListener('pagesinit', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Loading document.
|
// Loading document.
|
||||||
PDFJS.getDocument({
|
pdfjsDistBuildPdf.getDocument({
|
||||||
url: DEFAULT_URL,
|
url: DEFAULT_URL,
|
||||||
cMapUrl: CMAP_URL,
|
cMapUrl: CMAP_URL,
|
||||||
cMapPacked: CMAP_PACKED,
|
cMapPacked: CMAP_PACKED,
|
||||||
|
@ -15,14 +15,14 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
if (!PDFJS.PDFSinglePageViewer || !PDFJS.getDocument) {
|
if (!pdfjsDistBuildPdf.getDocument || !pdfjsDistWebPdfViewer.PDFSinglePageViewer) {
|
||||||
alert('Please build the pdfjs-dist library using\n' +
|
alert('Please build the pdfjs-dist library using\n' +
|
||||||
' `gulp dist-install`');
|
' `gulp dist-install`');
|
||||||
}
|
}
|
||||||
|
|
||||||
// The workerSrc property shall be specified.
|
// The workerSrc property shall be specified.
|
||||||
//
|
//
|
||||||
PDFJS.GlobalWorkerOptions.workerSrc =
|
pdfjsDistBuildPdf.GlobalWorkerOptions.workerSrc =
|
||||||
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
||||||
|
|
||||||
// Some PDFs need external cmaps.
|
// Some PDFs need external cmaps.
|
||||||
@ -36,17 +36,17 @@ var SEARCH_FOR = ''; // try 'Mozilla';
|
|||||||
var container = document.getElementById('viewerContainer');
|
var container = document.getElementById('viewerContainer');
|
||||||
|
|
||||||
// (Optionally) enable hyperlinks within PDF files.
|
// (Optionally) enable hyperlinks within PDF files.
|
||||||
var pdfLinkService = new PDFJS.PDFLinkService();
|
var pdfLinkService = new pdfjsDistWebPdfViewer.PDFLinkService();
|
||||||
|
|
||||||
var pdfSinglePageViewer = new PDFJS.PDFSinglePageViewer({
|
var pdfSinglePageViewer = new pdfjsDistWebPdfViewer.PDFSinglePageViewer({
|
||||||
container: container,
|
container: container,
|
||||||
linkService: pdfLinkService,
|
linkService: pdfLinkService,
|
||||||
});
|
});
|
||||||
pdfLinkService.setViewer(pdfSinglePageViewer);
|
pdfLinkService.setViewer(pdfSinglePageViewer);
|
||||||
|
|
||||||
// (Optionally) enable find controller.
|
// (Optionally) enable find controller.
|
||||||
var pdfFindController = new PDFJS.PDFFindController({
|
var pdfFindController = new pdfjsDistWebPdfViewer.PDFFindController({
|
||||||
pdfViewer: pdfSinglePageViewer
|
pdfViewer: pdfSinglePageViewer,
|
||||||
});
|
});
|
||||||
pdfSinglePageViewer.setFindController(pdfFindController);
|
pdfSinglePageViewer.setFindController(pdfFindController);
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ container.addEventListener('pagesinit', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Loading document.
|
// Loading document.
|
||||||
PDFJS.getDocument({
|
pdfjsDistBuildPdf.getDocument({
|
||||||
url: DEFAULT_URL,
|
url: DEFAULT_URL,
|
||||||
cMapUrl: CMAP_URL,
|
cMapUrl: CMAP_URL,
|
||||||
cMapPacked: CMAP_PACKED,
|
cMapPacked: CMAP_PACKED,
|
||||||
|
@ -22,13 +22,13 @@
|
|||||||
//
|
//
|
||||||
// The workerSrc property shall be specified.
|
// The workerSrc property shall be specified.
|
||||||
//
|
//
|
||||||
PDFJS.GlobalWorkerOptions.workerSrc =
|
pdfjsDistBuildPdf.GlobalWorkerOptions.workerSrc =
|
||||||
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
||||||
|
|
||||||
//
|
//
|
||||||
// Asynchronous download PDF
|
// Asynchronous download PDF
|
||||||
//
|
//
|
||||||
PDFJS.getDocument(url).then(function getPdfHelloWorld(pdf) {
|
pdfjsDistBuildPdf.getDocument(url).then(function getPdfHelloWorld(pdf) {
|
||||||
//
|
//
|
||||||
// Fetch the first page
|
// Fetch the first page
|
||||||
//
|
//
|
||||||
|
@ -34,12 +34,12 @@
|
|||||||
//
|
//
|
||||||
// The workerSrc property shall be specified.
|
// The workerSrc property shall be specified.
|
||||||
//
|
//
|
||||||
PDFJS.GlobalWorkerOptions.workerSrc =
|
pdfjsDistBuildPdf.GlobalWorkerOptions.workerSrc =
|
||||||
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
||||||
|
|
||||||
// Opening PDF by passing its binary data as a string. It is still preferable
|
// Opening PDF by passing its binary data as a string. It is still preferable
|
||||||
// to use Uint8Array, but string or array-like structure will work too.
|
// to use Uint8Array, but string or array-like structure will work too.
|
||||||
PDFJS.getDocument({data: pdfData}).then(function getPdfHelloWorld(pdf) {
|
pdfjsDistBuildPdf.getDocument({data: pdfData}).then(function getPdfHelloWorld(pdf) {
|
||||||
// Fetch the first page.
|
// Fetch the first page.
|
||||||
pdf.getPage(1).then(function getPageHelloWorld(page) {
|
pdf.getPage(1).then(function getPageHelloWorld(page) {
|
||||||
var scale = 1.5;
|
var scale = 1.5;
|
||||||
|
@ -33,8 +33,8 @@
|
|||||||
// pdf.js's one, or the pdf.js is executed via eval(), the workerSrc property
|
// pdf.js's one, or the pdf.js is executed via eval(), the workerSrc property
|
||||||
// shall be specified.
|
// shall be specified.
|
||||||
//
|
//
|
||||||
// PDFJS.GlobalWorkerOptions.workerSrc =
|
pdfjsDistBuildPdf.GlobalWorkerOptions.workerSrc =
|
||||||
// '../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
||||||
|
|
||||||
var pdfDoc = null,
|
var pdfDoc = null,
|
||||||
pageNum = 1,
|
pageNum = 1,
|
||||||
@ -117,7 +117,7 @@
|
|||||||
/**
|
/**
|
||||||
* Asynchronously downloads PDF.
|
* Asynchronously downloads PDF.
|
||||||
*/
|
*/
|
||||||
PDFJS.getDocument(url).then(function (pdfDoc_) {
|
pdfjsDistBuildPdf.getDocument(url).then(function (pdfDoc_) {
|
||||||
pdfDoc = pdfDoc_;
|
pdfDoc = pdfDoc_;
|
||||||
document.getElementById('page_count').textContent = pdfDoc.numPages;
|
document.getElementById('page_count').textContent = pdfDoc.numPages;
|
||||||
|
|
||||||
|
@ -12,13 +12,12 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
/* globals PDFJS */
|
/* globals pdfjsDistBuildPdf, pdfjsDistWebPdfViewer */
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
if (typeof PDFJS === 'undefined' || !PDFJS.PDFViewer || !PDFJS.getDocument) {
|
if (!pdfjsDistBuildPdf.getDocument || !pdfjsDistWebPdfViewer.PDFViewer) {
|
||||||
alert('Please build the pdfjs-dist library using\n' +
|
alert('Please build the pdfjs-dist library using\n `gulp dist-install`');
|
||||||
' `gulp dist-install`');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var USE_ONLY_CSS_ZOOM = true;
|
var USE_ONLY_CSS_ZOOM = true;
|
||||||
@ -27,7 +26,7 @@ var MAX_IMAGE_SIZE = 1024 * 1024;
|
|||||||
var CMAP_URL = '../../node_modules/pdfjs-dist/cmaps/';
|
var CMAP_URL = '../../node_modules/pdfjs-dist/cmaps/';
|
||||||
var CMAP_PACKED = true;
|
var CMAP_PACKED = true;
|
||||||
|
|
||||||
PDFJS.GlobalWorkerOptions.workerSrc =
|
pdfjsDistBuildPdf.GlobalWorkerOptions.workerSrc =
|
||||||
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
||||||
|
|
||||||
var DEFAULT_URL = '../../web/compressed.tracemonkey-pldi-09.pdf';
|
var DEFAULT_URL = '../../web/compressed.tracemonkey-pldi-09.pdf';
|
||||||
@ -62,7 +61,7 @@ var PDFViewerApplication = {
|
|||||||
this.setTitleUsingUrl(url);
|
this.setTitleUsingUrl(url);
|
||||||
|
|
||||||
// Loading document.
|
// Loading document.
|
||||||
var loadingTask = PDFJS.getDocument({
|
var loadingTask = pdfjsDistBuildPdf.getDocument({
|
||||||
url: url,
|
url: url,
|
||||||
maxImageSize: MAX_IMAGE_SIZE,
|
maxImageSize: MAX_IMAGE_SIZE,
|
||||||
cMapUrl: CMAP_URL,
|
cMapUrl: CMAP_URL,
|
||||||
@ -88,15 +87,15 @@ var PDFViewerApplication = {
|
|||||||
var l10n = self.l10n;
|
var l10n = self.l10n;
|
||||||
var loadingErrorMessage;
|
var loadingErrorMessage;
|
||||||
|
|
||||||
if (exception instanceof PDFJS.InvalidPDFException) {
|
if (exception instanceof pdfjsDistBuildPdf.InvalidPDFException) {
|
||||||
// change error message also for other builds
|
// change error message also for other builds
|
||||||
loadingErrorMessage = l10n.get('invalid_file_error', null,
|
loadingErrorMessage = l10n.get('invalid_file_error', null,
|
||||||
'Invalid or corrupted PDF file.');
|
'Invalid or corrupted PDF file.');
|
||||||
} else if (exception instanceof PDFJS.MissingPDFException) {
|
} else if (exception instanceof pdfjsDistBuildPdf.MissingPDFException) {
|
||||||
// special message for missing PDFs
|
// special message for missing PDFs
|
||||||
loadingErrorMessage = l10n.get('missing_file_error', null,
|
loadingErrorMessage = l10n.get('missing_file_error', null,
|
||||||
'Missing PDF file.');
|
'Missing PDF file.');
|
||||||
} else if (exception instanceof PDFJS.UnexpectedResponseException) {
|
} else if (exception instanceof pdfjsDistBuildPdf.UnexpectedResponseException) {
|
||||||
loadingErrorMessage = l10n.get('unexpected_response_error', null,
|
loadingErrorMessage = l10n.get('unexpected_response_error', null,
|
||||||
'Unexpected server response.');
|
'Unexpected server response.');
|
||||||
} else {
|
} else {
|
||||||
@ -138,14 +137,14 @@ var PDFViewerApplication = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
get loadingBar() {
|
get loadingBar() {
|
||||||
var bar = new PDFJS.ProgressBar('#loadingBar', {});
|
var bar = new pdfjsDistWebPdfViewer.ProgressBar('#loadingBar', {});
|
||||||
|
|
||||||
return PDFJS.shadow(this, 'loadingBar', bar);
|
return pdfjsDistBuildPdf.shadow(this, 'loadingBar', bar);
|
||||||
},
|
},
|
||||||
|
|
||||||
setTitleUsingUrl: function pdfViewSetTitleUsingUrl(url) {
|
setTitleUsingUrl: function pdfViewSetTitleUsingUrl(url) {
|
||||||
this.url = url;
|
this.url = url;
|
||||||
var title = PDFJS.getFilenameFromUrl(url) || url;
|
var title = pdfjsDistBuildPdf.getFilenameFromUrl(url) || url;
|
||||||
try {
|
try {
|
||||||
title = decodeURIComponent(title);
|
title = decodeURIComponent(title);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -166,8 +165,7 @@ var PDFViewerApplication = {
|
|||||||
console.log('PDF ' + pdfDocument.fingerprint + ' [' +
|
console.log('PDF ' + pdfDocument.fingerprint + ' [' +
|
||||||
info.PDFFormatVersion + ' ' + (info.Producer || '-').trim() +
|
info.PDFFormatVersion + ' ' + (info.Producer || '-').trim() +
|
||||||
' / ' + (info.Creator || '-').trim() + ']' +
|
' / ' + (info.Creator || '-').trim() + ']' +
|
||||||
' (PDF.js: ' + (PDFJS.version || '-') +
|
' (PDF.js: ' + (pdfjsDistBuildPdf.version || '-') + ')');
|
||||||
(!PDFJS.disableWebGL ? ' [WebGL]' : '') + ')');
|
|
||||||
|
|
||||||
var pdfTitle;
|
var pdfTitle;
|
||||||
if (metadata && metadata.has('dc:title')) {
|
if (metadata && metadata.has('dc:title')) {
|
||||||
@ -197,7 +195,8 @@ var PDFViewerApplication = {
|
|||||||
error: function pdfViewError(message, moreInfo) {
|
error: function pdfViewError(message, moreInfo) {
|
||||||
var l10n = this.l10n;
|
var l10n = this.l10n;
|
||||||
var moreInfoText = [l10n.get('error_version_info',
|
var moreInfoText = [l10n.get('error_version_info',
|
||||||
{version: PDFJS.version || '?', build: PDFJS.build || '?'},
|
{ version: pdfjsDistBuildPdf.version || '?',
|
||||||
|
build: pdfjsDistBuildPdf.build || '?' },
|
||||||
'PDF.js v{{version}} (build: {{build}})')];
|
'PDF.js v{{version}} (build: {{build}})')];
|
||||||
|
|
||||||
if (moreInfo) {
|
if (moreInfo) {
|
||||||
@ -295,13 +294,13 @@ var PDFViewerApplication = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
initUI: function pdfViewInitUI() {
|
initUI: function pdfViewInitUI() {
|
||||||
var linkService = new PDFJS.PDFLinkService();
|
var linkService = new pdfjsDistWebPdfViewer.PDFLinkService();
|
||||||
this.pdfLinkService = linkService;
|
this.pdfLinkService = linkService;
|
||||||
|
|
||||||
this.l10n = PDFJS.NullL10n;
|
this.l10n = pdfjsDistWebPdfViewer.NullL10n;
|
||||||
|
|
||||||
var container = document.getElementById('viewerContainer');
|
var container = document.getElementById('viewerContainer');
|
||||||
var pdfViewer = new PDFJS.PDFViewer({
|
var pdfViewer = new pdfjsDistWebPdfViewer.PDFViewer({
|
||||||
container: container,
|
container: container,
|
||||||
linkService: linkService,
|
linkService: linkService,
|
||||||
l10n: this.l10n,
|
l10n: this.l10n,
|
||||||
@ -311,7 +310,7 @@ var PDFViewerApplication = {
|
|||||||
this.pdfViewer = pdfViewer;
|
this.pdfViewer = pdfViewer;
|
||||||
linkService.setViewer(pdfViewer);
|
linkService.setViewer(pdfViewer);
|
||||||
|
|
||||||
this.pdfHistory = new PDFJS.PDFHistory({
|
this.pdfHistory = new pdfjsDistWebPdfViewer.PDFHistory({
|
||||||
linkService: linkService
|
linkService: linkService
|
||||||
});
|
});
|
||||||
linkService.setHistory(this.pdfHistory);
|
linkService.setHistory(this.pdfHistory);
|
||||||
|
@ -18,7 +18,7 @@ var PAGE_NUMBER = 1;
|
|||||||
var PAGE_SCALE = 1.5;
|
var PAGE_SCALE = 1.5;
|
||||||
var SVG_NS = 'http://www.w3.org/2000/svg';
|
var SVG_NS = 'http://www.w3.org/2000/svg';
|
||||||
|
|
||||||
PDFJS.GlobalWorkerOptions.workerSrc =
|
pdfjsDistBuildPdf.GlobalWorkerOptions.workerSrc =
|
||||||
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
||||||
|
|
||||||
function buildSVG(viewport, textContent) {
|
function buildSVG(viewport, textContent) {
|
||||||
@ -33,8 +33,8 @@ function buildSVG(viewport, textContent) {
|
|||||||
textContent.items.forEach(function (textItem) {
|
textContent.items.forEach(function (textItem) {
|
||||||
// we have to take in account viewport transform, which includes scale,
|
// we have to take in account viewport transform, which includes scale,
|
||||||
// rotation and Y-axis flip, and not forgetting to flip text.
|
// rotation and Y-axis flip, and not forgetting to flip text.
|
||||||
var tx = PDFJS.Util.transform(
|
var tx = pdfjsDistBuildPdf.Util.transform(
|
||||||
PDFJS.Util.transform(viewport.transform, textItem.transform),
|
pdfjsDistBuildPdf.Util.transform(viewport.transform, textItem.transform),
|
||||||
[1, 0, 0, -1, 0, 0]);
|
[1, 0, 0, -1, 0, 0]);
|
||||||
var style = textContent.styles[textItem.fontName];
|
var style = textContent.styles[textItem.fontName];
|
||||||
// adding text element
|
// adding text element
|
||||||
@ -49,7 +49,7 @@ function buildSVG(viewport, textContent) {
|
|||||||
|
|
||||||
function pageLoaded() {
|
function pageLoaded() {
|
||||||
// Loading document and page text content
|
// Loading document and page text content
|
||||||
PDFJS.getDocument({url: PDF_PATH}).then(function (pdfDocument) {
|
pdfjsDistBuildPdf.getDocument({url: PDF_PATH}).then(function (pdfDocument) {
|
||||||
pdfDocument.getPage(PAGE_NUMBER).then(function (page) {
|
pdfDocument.getPage(PAGE_NUMBER).then(function (page) {
|
||||||
var viewport = page.getViewport(PAGE_SCALE);
|
var viewport = page.getViewport(PAGE_SCALE);
|
||||||
page.getTextContent().then(function (textContent) {
|
page.getTextContent().then(function (textContent) {
|
||||||
@ -62,7 +62,7 @@ function pageLoaded() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
if (typeof PDFJS === 'undefined') {
|
if (typeof pdfjsDistBuildPdf === 'undefined') {
|
||||||
alert('Built version of PDF.js was not found.\n' +
|
alert('Built version of PDF.js was not found.\n' +
|
||||||
'Please run `gulp dist-install`.');
|
'Please run `gulp dist-install`.');
|
||||||
return;
|
return;
|
||||||
|
@ -934,7 +934,6 @@ gulp.task('jsdoc', function (done) {
|
|||||||
var JSDOC_FILES = [
|
var JSDOC_FILES = [
|
||||||
'src/doc_helper.js',
|
'src/doc_helper.js',
|
||||||
'src/display/api.js',
|
'src/display/api.js',
|
||||||
'src/display/global.js',
|
|
||||||
'src/shared/util.js',
|
'src/shared/util.js',
|
||||||
'src/core/annotation.js'
|
'src/core/annotation.js'
|
||||||
];
|
];
|
||||||
|
@ -1,82 +0,0 @@
|
|||||||
/* Copyright 2015 Mozilla Foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import {
|
|
||||||
createBlob, createPromiseCapability, InvalidPDFException, isLittleEndian,
|
|
||||||
MissingPDFException, OPS, PageViewport, PasswordException, PasswordResponses,
|
|
||||||
removeNullCharacters, shadow, UnexpectedResponseException,
|
|
||||||
UnknownErrorException, UNSUPPORTED_FEATURES, Util
|
|
||||||
} from '../shared/util';
|
|
||||||
import {
|
|
||||||
getDocument, LoopbackPort, PDFDataRangeTransport, PDFWorker
|
|
||||||
} from './api';
|
|
||||||
import { AnnotationLayer } from './annotation_layer';
|
|
||||||
import { getFilenameFromUrl } from './dom_utils';
|
|
||||||
import globalScope from '../shared/global_scope';
|
|
||||||
import { GlobalWorkerOptions } from './worker_options';
|
|
||||||
import { Metadata } from './metadata';
|
|
||||||
import { renderTextLayer } from './text_layer';
|
|
||||||
import { SVGGraphics } from './svg';
|
|
||||||
|
|
||||||
// The global PDFJS object is now deprecated and will not be supported in
|
|
||||||
// the future. The members below are maintained for backward compatibility
|
|
||||||
// and shall not be extended or modified. If the global.js is included as
|
|
||||||
// a module, we will create a global PDFJS object instance or use existing.
|
|
||||||
if (!globalScope.PDFJS) {
|
|
||||||
globalScope.PDFJS = {};
|
|
||||||
}
|
|
||||||
var PDFJS = globalScope.PDFJS;
|
|
||||||
|
|
||||||
PDFJS.OPS = OPS;
|
|
||||||
PDFJS.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES;
|
|
||||||
PDFJS.shadow = shadow;
|
|
||||||
PDFJS.createBlob = createBlob;
|
|
||||||
Object.defineProperty(PDFJS, 'isLittleEndian', {
|
|
||||||
configurable: true,
|
|
||||||
get: function PDFJS_isLittleEndian() {
|
|
||||||
return shadow(PDFJS, 'isLittleEndian', isLittleEndian());
|
|
||||||
},
|
|
||||||
});
|
|
||||||
PDFJS.removeNullCharacters = removeNullCharacters;
|
|
||||||
PDFJS.PasswordResponses = PasswordResponses;
|
|
||||||
PDFJS.PasswordException = PasswordException;
|
|
||||||
PDFJS.UnknownErrorException = UnknownErrorException;
|
|
||||||
PDFJS.InvalidPDFException = InvalidPDFException;
|
|
||||||
PDFJS.MissingPDFException = MissingPDFException;
|
|
||||||
PDFJS.UnexpectedResponseException = UnexpectedResponseException;
|
|
||||||
PDFJS.Util = Util;
|
|
||||||
PDFJS.PageViewport = PageViewport;
|
|
||||||
PDFJS.createPromiseCapability = createPromiseCapability;
|
|
||||||
|
|
||||||
PDFJS.getDocument = getDocument;
|
|
||||||
PDFJS.LoopbackPort = LoopbackPort;
|
|
||||||
PDFJS.PDFDataRangeTransport = PDFDataRangeTransport;
|
|
||||||
PDFJS.PDFWorker = PDFWorker;
|
|
||||||
PDFJS.GlobalWorkerOptions = GlobalWorkerOptions;
|
|
||||||
|
|
||||||
PDFJS.getFilenameFromUrl = getFilenameFromUrl;
|
|
||||||
|
|
||||||
PDFJS.AnnotationLayer = AnnotationLayer;
|
|
||||||
|
|
||||||
PDFJS.renderTextLayer = renderTextLayer;
|
|
||||||
|
|
||||||
PDFJS.Metadata = Metadata;
|
|
||||||
|
|
||||||
PDFJS.SVGGraphics = SVGGraphics;
|
|
||||||
|
|
||||||
export {
|
|
||||||
globalScope,
|
|
||||||
PDFJS,
|
|
||||||
};
|
|
@ -18,15 +18,6 @@
|
|||||||
It is not for use in the executable code.
|
It is not for use in the executable code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* PDFJS scope object that contains all functions, objects and variables related
|
|
||||||
* to the PDF.js.
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function PDFJS() { // eslint-disable-line no-unused-vars
|
|
||||||
// Mock class constructor. See src/display/api.js.
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the eventual result of an asynchronous operation.
|
* Represents the eventual result of an asynchronous operation.
|
||||||
* @external Promise
|
* @external Promise
|
||||||
|
@ -22,7 +22,6 @@ var pdfjsBuild =
|
|||||||
typeof PDFJSDev !== 'undefined' ? PDFJSDev.eval('BUNDLE_BUILD') : void 0;
|
typeof PDFJSDev !== 'undefined' ? PDFJSDev.eval('BUNDLE_BUILD') : void 0;
|
||||||
|
|
||||||
var pdfjsSharedUtil = require('./shared/util.js');
|
var pdfjsSharedUtil = require('./shared/util.js');
|
||||||
var pdfjsDisplayGlobal = require('./display/global.js');
|
|
||||||
var pdfjsDisplayAPI = require('./display/api.js');
|
var pdfjsDisplayAPI = require('./display/api.js');
|
||||||
var pdfjsDisplayTextLayer = require('./display/text_layer.js');
|
var pdfjsDisplayTextLayer = require('./display/text_layer.js');
|
||||||
var pdfjsDisplayAnnotationLayer = require('./display/annotation_layer.js');
|
var pdfjsDisplayAnnotationLayer = require('./display/annotation_layer.js');
|
||||||
@ -66,7 +65,6 @@ if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.PDFJS = pdfjsDisplayGlobal.PDFJS;
|
|
||||||
exports.build = pdfjsDisplayAPI.build;
|
exports.build = pdfjsDisplayAPI.build;
|
||||||
exports.version = pdfjsDisplayAPI.version;
|
exports.version = pdfjsDisplayAPI.version;
|
||||||
exports.getDocument = pdfjsDisplayAPI.getDocument;
|
exports.getDocument = pdfjsDisplayAPI.getDocument;
|
||||||
@ -91,6 +89,7 @@ exports.createObjectURL = pdfjsSharedUtil.createObjectURL;
|
|||||||
exports.removeNullCharacters = pdfjsSharedUtil.removeNullCharacters;
|
exports.removeNullCharacters = pdfjsSharedUtil.removeNullCharacters;
|
||||||
exports.shadow = pdfjsSharedUtil.shadow;
|
exports.shadow = pdfjsSharedUtil.shadow;
|
||||||
exports.createBlob = pdfjsSharedUtil.createBlob;
|
exports.createBlob = pdfjsSharedUtil.createBlob;
|
||||||
|
exports.Util = pdfjsSharedUtil.Util;
|
||||||
exports.RenderingCancelledException =
|
exports.RenderingCancelledException =
|
||||||
pdfjsDisplayDOMUtils.RenderingCancelledException;
|
pdfjsDisplayDOMUtils.RenderingCancelledException;
|
||||||
exports.getFilenameFromUrl = pdfjsDisplayDOMUtils.getFilenameFromUrl;
|
exports.getFilenameFromUrl = pdfjsDisplayDOMUtils.getFilenameFromUrl;
|
||||||
|
@ -13,32 +13,26 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
/* eslint-disable mozilla/use-includes-instead-of-indexOf */
|
/* eslint-disable mozilla/use-includes-instead-of-indexOf */
|
||||||
/* globals PDFJS */
|
|
||||||
|
const globalScope = require('./global_scope');
|
||||||
|
|
||||||
// Skip compatibility checks for the extensions and if we already ran
|
// Skip compatibility checks for the extensions and if we already ran
|
||||||
// this module.
|
// this module.
|
||||||
if ((typeof PDFJSDev === 'undefined' ||
|
if ((typeof PDFJSDev === 'undefined' ||
|
||||||
!PDFJSDev.test('FIREFOX || MOZCENTRAL')) &&
|
!PDFJSDev.test('FIREFOX || MOZCENTRAL')) &&
|
||||||
(typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked)) {
|
!globalScope._pdfjsCompatibilityChecked) {
|
||||||
|
|
||||||
|
globalScope._pdfjsCompatibilityChecked = true;
|
||||||
|
|
||||||
// In the Chrome extension, most of the polyfills are unnecessary.
|
// In the Chrome extension, most of the polyfills are unnecessary.
|
||||||
// We support down to Chrome 49, because it's still commonly used by Windows XP
|
// We support down to Chrome 49, because it's still commonly used by Windows XP
|
||||||
// users - https://github.com/mozilla/pdf.js/issues/9397
|
// users - https://github.com/mozilla/pdf.js/issues/9397
|
||||||
if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('CHROME')) {
|
if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('CHROME')) {
|
||||||
|
|
||||||
const globalScope = require('./global_scope');
|
|
||||||
const isNodeJS = require('./is_node');
|
const isNodeJS = require('./is_node');
|
||||||
|
|
||||||
const hasDOM = typeof window === 'object' && typeof document === 'object';
|
const hasDOM = typeof window === 'object' && typeof document === 'object';
|
||||||
|
|
||||||
// Initializing PDFJS global object here, it case if we need to change/disable
|
|
||||||
// some PDF.js features, e.g. range requests
|
|
||||||
if (typeof PDFJS === 'undefined') {
|
|
||||||
globalScope.PDFJS = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
PDFJS.compatibilityChecked = true;
|
|
||||||
|
|
||||||
// Support: Node.js
|
// Support: Node.js
|
||||||
(function checkNodeBtoa() {
|
(function checkNodeBtoa() {
|
||||||
if (globalScope.btoa || !isNodeJS()) {
|
if (globalScope.btoa || !isNodeJS()) {
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
/* globals PDFJS, pdfjsDistBuildPdf */
|
/* globals pdfjsDistBuildPdf, pdfjsDistWebPdfViewer */
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ var rasterizeTextLayer = (function rasterizeTextLayerClosure() {
|
|||||||
foreignObject.appendChild(div);
|
foreignObject.appendChild(div);
|
||||||
|
|
||||||
// Rendering text layer as HTML.
|
// Rendering text layer as HTML.
|
||||||
var task = PDFJS.renderTextLayer({
|
var task = pdfjsDistBuildPdf.renderTextLayer({
|
||||||
textContent,
|
textContent,
|
||||||
container: div,
|
container: div,
|
||||||
viewport,
|
viewport,
|
||||||
@ -204,11 +204,11 @@ var rasterizeAnnotationLayer = (function rasterizeAnnotationLayerClosure() {
|
|||||||
div,
|
div,
|
||||||
annotations,
|
annotations,
|
||||||
page,
|
page,
|
||||||
linkService: new PDFJS.SimpleLinkService(),
|
linkService: new pdfjsDistWebPdfViewer.SimpleLinkService(),
|
||||||
imageResourcesPath,
|
imageResourcesPath,
|
||||||
renderInteractiveForms,
|
renderInteractiveForms,
|
||||||
};
|
};
|
||||||
PDFJS.AnnotationLayer.render(parameters);
|
pdfjsDistBuildPdf.AnnotationLayer.render(parameters);
|
||||||
|
|
||||||
// Inline SVG images from text annotations.
|
// Inline SVG images from text annotations.
|
||||||
var images = div.getElementsByTagName('img');
|
var images = div.getElementsByTagName('img');
|
||||||
@ -271,7 +271,7 @@ var Driver = (function DriverClosure() { // eslint-disable-line no-unused-vars
|
|||||||
*/
|
*/
|
||||||
function Driver(options) {
|
function Driver(options) {
|
||||||
// Configure the global worker options.
|
// Configure the global worker options.
|
||||||
PDFJS.GlobalWorkerOptions.workerSrc = WORKER_SRC;
|
pdfjsDistBuildPdf.GlobalWorkerOptions.workerSrc = WORKER_SRC;
|
||||||
|
|
||||||
// Set the passed options
|
// Set the passed options
|
||||||
this.inflight = options.inflight;
|
this.inflight = options.inflight;
|
||||||
@ -358,7 +358,7 @@ var Driver = (function DriverClosure() { // eslint-disable-line no-unused-vars
|
|||||||
|
|
||||||
let absoluteUrl = new URL(task.file, window.location).href;
|
let absoluteUrl = new URL(task.file, window.location).href;
|
||||||
try {
|
try {
|
||||||
PDFJS.getDocument({
|
pdfjsDistBuildPdf.getDocument({
|
||||||
url: absoluteUrl,
|
url: absoluteUrl,
|
||||||
password: task.password,
|
password: task.password,
|
||||||
nativeImageDecoderSupport: task.nativeImageDecoderSupport,
|
nativeImageDecoderSupport: task.nativeImageDecoderSupport,
|
||||||
|
@ -58,266 +58,265 @@ describe('api', function() {
|
|||||||
}, WAIT_TIMEOUT);
|
}, WAIT_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
describe('PDFJS', function() {
|
describe('getDocument', function() {
|
||||||
describe('getDocument', function() {
|
it('creates pdf doc from URL', function(done) {
|
||||||
it('creates pdf doc from URL', function(done) {
|
var loadingTask = getDocument(basicApiGetDocumentParams);
|
||||||
var loadingTask = getDocument(basicApiGetDocumentParams);
|
|
||||||
|
|
||||||
var isProgressReportedResolved = false;
|
var isProgressReportedResolved = false;
|
||||||
var progressReportedCapability = createPromiseCapability();
|
var progressReportedCapability = createPromiseCapability();
|
||||||
|
|
||||||
// Attach the callback that is used to report loading progress;
|
// Attach the callback that is used to report loading progress;
|
||||||
// similarly to how viewer.js works.
|
// similarly to how viewer.js works.
|
||||||
loadingTask.onProgress = function (progressData) {
|
loadingTask.onProgress = function (progressData) {
|
||||||
if (!isProgressReportedResolved) {
|
if (!isProgressReportedResolved) {
|
||||||
isProgressReportedResolved = true;
|
isProgressReportedResolved = true;
|
||||||
progressReportedCapability.resolve(progressData);
|
progressReportedCapability.resolve(progressData);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var promises = [
|
var promises = [
|
||||||
progressReportedCapability.promise,
|
progressReportedCapability.promise,
|
||||||
loadingTask.promise
|
loadingTask.promise
|
||||||
];
|
];
|
||||||
Promise.all(promises).then(function (data) {
|
Promise.all(promises).then(function (data) {
|
||||||
expect((data[0].loaded / data[0].total) > 0).toEqual(true);
|
expect((data[0].loaded / data[0].total) > 0).toEqual(true);
|
||||||
expect(data[1] instanceof PDFDocumentProxy).toEqual(true);
|
expect(data[1] instanceof PDFDocumentProxy).toEqual(true);
|
||||||
expect(loadingTask).toEqual(data[1].loadingTask);
|
expect(loadingTask).toEqual(data[1].loadingTask);
|
||||||
loadingTask.destroy().then(done);
|
loadingTask.destroy().then(done);
|
||||||
}).catch(function (reason) {
|
}).catch(function (reason) {
|
||||||
done.fail(reason);
|
done.fail(reason);
|
||||||
});
|
|
||||||
});
|
});
|
||||||
it('creates pdf doc from URL and aborts before worker initialized',
|
});
|
||||||
function(done) {
|
it('creates pdf doc from URL and aborts before worker initialized',
|
||||||
var loadingTask = getDocument(basicApiGetDocumentParams);
|
function(done) {
|
||||||
let destroyed = loadingTask.destroy();
|
var loadingTask = getDocument(basicApiGetDocumentParams);
|
||||||
|
let destroyed = loadingTask.destroy();
|
||||||
|
|
||||||
loadingTask.promise.then(function(reason) {
|
loadingTask.promise.then(function(reason) {
|
||||||
done.fail('shall fail loading');
|
done.fail('shall fail loading');
|
||||||
}).catch(function (reason) {
|
}).catch(function (reason) {
|
||||||
expect(true).toEqual(true);
|
expect(true).toEqual(true);
|
||||||
destroyed.then(done);
|
destroyed.then(done);
|
||||||
});
|
|
||||||
});
|
});
|
||||||
it('creates pdf doc from URL and aborts loading after worker initialized',
|
});
|
||||||
function(done) {
|
it('creates pdf doc from URL and aborts loading after worker initialized',
|
||||||
var loadingTask = getDocument(basicApiGetDocumentParams);
|
function(done) {
|
||||||
// This can be somewhat random -- we cannot guarantee perfect
|
var loadingTask = getDocument(basicApiGetDocumentParams);
|
||||||
// 'Terminate' message to the worker before/after setting up pdfManager.
|
// This can be somewhat random -- we cannot guarantee perfect
|
||||||
var destroyed = loadingTask._worker.promise.then(function () {
|
// 'Terminate' message to the worker before/after setting up pdfManager.
|
||||||
return loadingTask.destroy();
|
var destroyed = loadingTask._worker.promise.then(function () {
|
||||||
});
|
return loadingTask.destroy();
|
||||||
destroyed.then(function (data) {
|
|
||||||
expect(true).toEqual(true);
|
|
||||||
done();
|
|
||||||
}).catch(function (reason) {
|
|
||||||
done.fail(reason);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
it('creates pdf doc from typed array', function(done) {
|
destroyed.then(function (data) {
|
||||||
var typedArrayPdf;
|
expect(true).toEqual(true);
|
||||||
if (isNodeJS()) {
|
done();
|
||||||
typedArrayPdf = NodeFileReaderFactory.fetch({
|
}).catch(function (reason) {
|
||||||
path: TEST_PDFS_PATH.node + basicApiFileName,
|
done.fail(reason);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
it('creates pdf doc from typed array', function(done) {
|
||||||
|
var typedArrayPdf;
|
||||||
|
if (isNodeJS()) {
|
||||||
|
typedArrayPdf = NodeFileReaderFactory.fetch({
|
||||||
|
path: TEST_PDFS_PATH.node + basicApiFileName,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
let nonBinaryRequest = false;
|
||||||
|
let request = new XMLHttpRequest();
|
||||||
|
request.open('GET', TEST_PDFS_PATH.dom + basicApiFileName, false);
|
||||||
|
try {
|
||||||
|
request.responseType = 'arraybuffer';
|
||||||
|
nonBinaryRequest = request.responseType !== 'arraybuffer';
|
||||||
|
} catch (e) {
|
||||||
|
nonBinaryRequest = true;
|
||||||
|
}
|
||||||
|
if (nonBinaryRequest && request.overrideMimeType) {
|
||||||
|
request.overrideMimeType('text/plain; charset=x-user-defined');
|
||||||
|
}
|
||||||
|
request.send(null);
|
||||||
|
|
||||||
|
if (nonBinaryRequest) {
|
||||||
|
typedArrayPdf = stringToBytes(request.responseText);
|
||||||
} else {
|
} else {
|
||||||
let nonBinaryRequest = false;
|
typedArrayPdf = new Uint8Array(request.response);
|
||||||
let request = new XMLHttpRequest();
|
|
||||||
request.open('GET', TEST_PDFS_PATH.dom + basicApiFileName, false);
|
|
||||||
try {
|
|
||||||
request.responseType = 'arraybuffer';
|
|
||||||
nonBinaryRequest = request.responseType !== 'arraybuffer';
|
|
||||||
} catch (e) {
|
|
||||||
nonBinaryRequest = true;
|
|
||||||
}
|
|
||||||
if (nonBinaryRequest && request.overrideMimeType) {
|
|
||||||
request.overrideMimeType('text/plain; charset=x-user-defined');
|
|
||||||
}
|
|
||||||
request.send(null);
|
|
||||||
|
|
||||||
if (nonBinaryRequest) {
|
|
||||||
typedArrayPdf = stringToBytes(request.responseText);
|
|
||||||
} else {
|
|
||||||
typedArrayPdf = new Uint8Array(request.response);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Sanity check to make sure that we fetched the entire PDF file.
|
}
|
||||||
expect(typedArrayPdf.length).toEqual(basicApiFileLength);
|
// Sanity check to make sure that we fetched the entire PDF file.
|
||||||
|
expect(typedArrayPdf.length).toEqual(basicApiFileLength);
|
||||||
|
|
||||||
var loadingTask = getDocument(typedArrayPdf);
|
var loadingTask = getDocument(typedArrayPdf);
|
||||||
loadingTask.promise.then(function(data) {
|
loadingTask.promise.then(function(data) {
|
||||||
expect(data instanceof PDFDocumentProxy).toEqual(true);
|
expect(data instanceof PDFDocumentProxy).toEqual(true);
|
||||||
loadingTask.destroy().then(done);
|
loadingTask.destroy().then(done);
|
||||||
}).catch(function (reason) {
|
}).catch(function (reason) {
|
||||||
done.fail(reason);
|
done.fail(reason);
|
||||||
});
|
|
||||||
});
|
});
|
||||||
it('creates pdf doc from invalid PDF file', function(done) {
|
});
|
||||||
// A severely corrupt PDF file (even Adobe Reader fails to open it).
|
it('creates pdf doc from invalid PDF file', function(done) {
|
||||||
var loadingTask = getDocument(buildGetDocumentParams('bug1020226.pdf'));
|
// A severely corrupt PDF file (even Adobe Reader fails to open it).
|
||||||
loadingTask.promise.then(function () {
|
var loadingTask = getDocument(buildGetDocumentParams('bug1020226.pdf'));
|
||||||
done.fail('shall fail loading');
|
loadingTask.promise.then(function () {
|
||||||
}).catch(function (error) {
|
done.fail('shall fail loading');
|
||||||
expect(error instanceof InvalidPDFException).toEqual(true);
|
}).catch(function (error) {
|
||||||
loadingTask.destroy().then(done);
|
expect(error instanceof InvalidPDFException).toEqual(true);
|
||||||
});
|
loadingTask.destroy().then(done);
|
||||||
});
|
});
|
||||||
it('creates pdf doc from non-existent URL', function(done) {
|
});
|
||||||
if (isNodeJS()) {
|
it('creates pdf doc from non-existent URL', function(done) {
|
||||||
pending('XMLHttpRequest is not supported in Node.js.');
|
if (isNodeJS()) {
|
||||||
|
pending('XMLHttpRequest is not supported in Node.js.');
|
||||||
|
}
|
||||||
|
var loadingTask = getDocument(
|
||||||
|
buildGetDocumentParams('non-existent.pdf'));
|
||||||
|
loadingTask.promise.then(function(error) {
|
||||||
|
done.fail('shall fail loading');
|
||||||
|
}).catch(function (error) {
|
||||||
|
expect(error instanceof MissingPDFException).toEqual(true);
|
||||||
|
loadingTask.destroy().then(done);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('creates pdf doc from PDF file protected with user and owner password',
|
||||||
|
function (done) {
|
||||||
|
var loadingTask = getDocument(buildGetDocumentParams('pr6531_1.pdf'));
|
||||||
|
|
||||||
|
var isPasswordNeededResolved = false;
|
||||||
|
var passwordNeededCapability = createPromiseCapability();
|
||||||
|
var isPasswordIncorrectResolved = false;
|
||||||
|
var passwordIncorrectCapability = createPromiseCapability();
|
||||||
|
|
||||||
|
// Attach the callback that is used to request a password;
|
||||||
|
// similarly to how viewer.js handles passwords.
|
||||||
|
loadingTask.onPassword = function (updatePassword, reason) {
|
||||||
|
if (reason === PasswordResponses.NEED_PASSWORD &&
|
||||||
|
!isPasswordNeededResolved) {
|
||||||
|
isPasswordNeededResolved = true;
|
||||||
|
passwordNeededCapability.resolve();
|
||||||
|
|
||||||
|
updatePassword('qwerty'); // Provide an incorrect password.
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
var loadingTask = getDocument(
|
if (reason === PasswordResponses.INCORRECT_PASSWORD &&
|
||||||
buildGetDocumentParams('non-existent.pdf'));
|
!isPasswordIncorrectResolved) {
|
||||||
loadingTask.promise.then(function(error) {
|
isPasswordIncorrectResolved = true;
|
||||||
done.fail('shall fail loading');
|
passwordIncorrectCapability.resolve();
|
||||||
}).catch(function (error) {
|
|
||||||
expect(error instanceof MissingPDFException).toEqual(true);
|
updatePassword('asdfasdf'); // Provide the correct password.
|
||||||
loadingTask.destroy().then(done);
|
return;
|
||||||
});
|
}
|
||||||
|
// Shouldn't get here.
|
||||||
|
expect(false).toEqual(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
var promises = [
|
||||||
|
passwordNeededCapability.promise,
|
||||||
|
passwordIncorrectCapability.promise,
|
||||||
|
loadingTask.promise
|
||||||
|
];
|
||||||
|
Promise.all(promises).then(function (data) {
|
||||||
|
expect(data[2] instanceof PDFDocumentProxy).toEqual(true);
|
||||||
|
loadingTask.destroy().then(done);
|
||||||
|
}).catch(function (reason) {
|
||||||
|
done.fail(reason);
|
||||||
});
|
});
|
||||||
it('creates pdf doc from PDF file protected with user and owner password',
|
});
|
||||||
function (done) {
|
it('creates pdf doc from PDF file protected with only a user password',
|
||||||
var loadingTask = getDocument(buildGetDocumentParams('pr6531_1.pdf'));
|
function (done) {
|
||||||
|
var filename = 'pr6531_2.pdf';
|
||||||
|
|
||||||
var isPasswordNeededResolved = false;
|
var passwordNeededLoadingTask = getDocument(
|
||||||
var passwordNeededCapability = createPromiseCapability();
|
buildGetDocumentParams(filename, {
|
||||||
var isPasswordIncorrectResolved = false;
|
password: '',
|
||||||
var passwordIncorrectCapability = createPromiseCapability();
|
}));
|
||||||
|
var result1 = passwordNeededLoadingTask.promise.then(function () {
|
||||||
// Attach the callback that is used to request a password;
|
done.fail('shall fail with no password');
|
||||||
// similarly to how viewer.js handles passwords.
|
return Promise.reject(new Error('loadingTask should be rejected'));
|
||||||
loadingTask.onPassword = function (updatePassword, reason) {
|
}, function (data) {
|
||||||
if (reason === PasswordResponses.NEED_PASSWORD &&
|
expect(data instanceof PasswordException).toEqual(true);
|
||||||
!isPasswordNeededResolved) {
|
expect(data.code).toEqual(PasswordResponses.NEED_PASSWORD);
|
||||||
isPasswordNeededResolved = true;
|
return passwordNeededLoadingTask.destroy();
|
||||||
passwordNeededCapability.resolve();
|
|
||||||
|
|
||||||
updatePassword('qwerty'); // Provide an incorrect password.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (reason === PasswordResponses.INCORRECT_PASSWORD &&
|
|
||||||
!isPasswordIncorrectResolved) {
|
|
||||||
isPasswordIncorrectResolved = true;
|
|
||||||
passwordIncorrectCapability.resolve();
|
|
||||||
|
|
||||||
updatePassword('asdfasdf'); // Provide the correct password.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Shouldn't get here.
|
|
||||||
expect(false).toEqual(true);
|
|
||||||
};
|
|
||||||
|
|
||||||
var promises = [
|
|
||||||
passwordNeededCapability.promise,
|
|
||||||
passwordIncorrectCapability.promise,
|
|
||||||
loadingTask.promise
|
|
||||||
];
|
|
||||||
Promise.all(promises).then(function (data) {
|
|
||||||
expect(data[2] instanceof PDFDocumentProxy).toEqual(true);
|
|
||||||
loadingTask.destroy().then(done);
|
|
||||||
}).catch(function (reason) {
|
|
||||||
done.fail(reason);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
it('creates pdf doc from PDF file protected with only a user password',
|
|
||||||
function (done) {
|
|
||||||
var filename = 'pr6531_2.pdf';
|
|
||||||
|
|
||||||
var passwordNeededLoadingTask = getDocument(
|
|
||||||
buildGetDocumentParams(filename, {
|
|
||||||
password: '',
|
|
||||||
}));
|
|
||||||
var result1 = passwordNeededLoadingTask.promise.then(function () {
|
|
||||||
done.fail('shall fail with no password');
|
|
||||||
return Promise.reject(new Error('loadingTask should be rejected'));
|
|
||||||
}, function (data) {
|
|
||||||
expect(data instanceof PasswordException).toEqual(true);
|
|
||||||
expect(data.code).toEqual(PasswordResponses.NEED_PASSWORD);
|
|
||||||
return passwordNeededLoadingTask.destroy();
|
|
||||||
});
|
|
||||||
|
|
||||||
var passwordIncorrectLoadingTask = getDocument(
|
|
||||||
buildGetDocumentParams(filename, {
|
|
||||||
password: 'qwerty',
|
|
||||||
}));
|
|
||||||
var result2 = passwordIncorrectLoadingTask.promise.then(function () {
|
|
||||||
done.fail('shall fail with wrong password');
|
|
||||||
return Promise.reject(new Error('loadingTask should be rejected'));
|
|
||||||
}, function (data) {
|
|
||||||
expect(data instanceof PasswordException).toEqual(true);
|
|
||||||
expect(data.code).toEqual(PasswordResponses.INCORRECT_PASSWORD);
|
|
||||||
return passwordIncorrectLoadingTask.destroy();
|
|
||||||
});
|
|
||||||
|
|
||||||
var passwordAcceptedLoadingTask = getDocument(
|
|
||||||
buildGetDocumentParams(filename, {
|
|
||||||
password: 'asdfasdf',
|
|
||||||
}));
|
|
||||||
var result3 = passwordAcceptedLoadingTask.promise.then(function (data) {
|
|
||||||
expect(data instanceof PDFDocumentProxy).toEqual(true);
|
|
||||||
return passwordAcceptedLoadingTask.destroy();
|
|
||||||
});
|
|
||||||
Promise.all([result1, result2, result3]).then(function () {
|
|
||||||
done();
|
|
||||||
}).catch(function (reason) {
|
|
||||||
done.fail(reason);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('creates pdf doc from password protected PDF file and aborts/throws ' +
|
var passwordIncorrectLoadingTask = getDocument(
|
||||||
'in the onPassword callback (issue 7806)', function (done) {
|
buildGetDocumentParams(filename, {
|
||||||
var filename = 'issue3371.pdf';
|
password: 'qwerty',
|
||||||
|
}));
|
||||||
|
var result2 = passwordIncorrectLoadingTask.promise.then(function () {
|
||||||
|
done.fail('shall fail with wrong password');
|
||||||
|
return Promise.reject(new Error('loadingTask should be rejected'));
|
||||||
|
}, function (data) {
|
||||||
|
expect(data instanceof PasswordException).toEqual(true);
|
||||||
|
expect(data.code).toEqual(PasswordResponses.INCORRECT_PASSWORD);
|
||||||
|
return passwordIncorrectLoadingTask.destroy();
|
||||||
|
});
|
||||||
|
|
||||||
var passwordNeededLoadingTask = getDocument(
|
var passwordAcceptedLoadingTask = getDocument(
|
||||||
buildGetDocumentParams(filename));
|
buildGetDocumentParams(filename, {
|
||||||
var passwordIncorrectLoadingTask = getDocument(
|
password: 'asdfasdf',
|
||||||
buildGetDocumentParams(filename, {
|
}));
|
||||||
password: 'qwerty',
|
var result3 = passwordAcceptedLoadingTask.promise.then(function (data) {
|
||||||
}));
|
expect(data instanceof PDFDocumentProxy).toEqual(true);
|
||||||
|
return passwordAcceptedLoadingTask.destroy();
|
||||||
|
});
|
||||||
|
Promise.all([result1, result2, result3]).then(function () {
|
||||||
|
done();
|
||||||
|
}).catch(function (reason) {
|
||||||
|
done.fail(reason);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
let passwordNeededDestroyed;
|
it('creates pdf doc from password protected PDF file and aborts/throws ' +
|
||||||
passwordNeededLoadingTask.onPassword = function (callback, reason) {
|
'in the onPassword callback (issue 7806)', function (done) {
|
||||||
if (reason === PasswordResponses.NEED_PASSWORD) {
|
var filename = 'issue3371.pdf';
|
||||||
passwordNeededDestroyed = passwordNeededLoadingTask.destroy();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Shouldn't get here.
|
|
||||||
expect(false).toEqual(true);
|
|
||||||
};
|
|
||||||
var result1 = passwordNeededLoadingTask.promise.then(function () {
|
|
||||||
done.fail('shall fail since the loadingTask should be destroyed');
|
|
||||||
return Promise.reject(new Error('loadingTask should be rejected'));
|
|
||||||
}, function (reason) {
|
|
||||||
expect(reason instanceof PasswordException).toEqual(true);
|
|
||||||
expect(reason.code).toEqual(PasswordResponses.NEED_PASSWORD);
|
|
||||||
return passwordNeededDestroyed;
|
|
||||||
});
|
|
||||||
|
|
||||||
passwordIncorrectLoadingTask.onPassword = function (callback, reason) {
|
var passwordNeededLoadingTask = getDocument(
|
||||||
if (reason === PasswordResponses.INCORRECT_PASSWORD) {
|
buildGetDocumentParams(filename));
|
||||||
throw new Error('Incorrect password');
|
var passwordIncorrectLoadingTask = getDocument(
|
||||||
}
|
buildGetDocumentParams(filename, {
|
||||||
// Shouldn't get here.
|
password: 'qwerty',
|
||||||
expect(false).toEqual(true);
|
}));
|
||||||
};
|
|
||||||
var result2 = passwordIncorrectLoadingTask.promise.then(function () {
|
|
||||||
done.fail('shall fail since the onPassword callback should throw');
|
|
||||||
return Promise.reject(new Error('loadingTask should be rejected'));
|
|
||||||
}, function (reason) {
|
|
||||||
expect(reason instanceof PasswordException).toEqual(true);
|
|
||||||
expect(reason.code).toEqual(PasswordResponses.INCORRECT_PASSWORD);
|
|
||||||
return passwordIncorrectLoadingTask.destroy();
|
|
||||||
});
|
|
||||||
|
|
||||||
Promise.all([result1, result2]).then(function () {
|
let passwordNeededDestroyed;
|
||||||
done();
|
passwordNeededLoadingTask.onPassword = function (callback, reason) {
|
||||||
}).catch(function (reason) {
|
if (reason === PasswordResponses.NEED_PASSWORD) {
|
||||||
done.fail(reason);
|
passwordNeededDestroyed = passwordNeededLoadingTask.destroy();
|
||||||
});
|
return;
|
||||||
|
}
|
||||||
|
// Shouldn't get here.
|
||||||
|
expect(false).toEqual(true);
|
||||||
|
};
|
||||||
|
var result1 = passwordNeededLoadingTask.promise.then(function () {
|
||||||
|
done.fail('shall fail since the loadingTask should be destroyed');
|
||||||
|
return Promise.reject(new Error('loadingTask should be rejected'));
|
||||||
|
}, function (reason) {
|
||||||
|
expect(reason instanceof PasswordException).toEqual(true);
|
||||||
|
expect(reason.code).toEqual(PasswordResponses.NEED_PASSWORD);
|
||||||
|
return passwordNeededDestroyed;
|
||||||
|
});
|
||||||
|
|
||||||
|
passwordIncorrectLoadingTask.onPassword = function (callback, reason) {
|
||||||
|
if (reason === PasswordResponses.INCORRECT_PASSWORD) {
|
||||||
|
throw new Error('Incorrect password');
|
||||||
|
}
|
||||||
|
// Shouldn't get here.
|
||||||
|
expect(false).toEqual(true);
|
||||||
|
};
|
||||||
|
var result2 = passwordIncorrectLoadingTask.promise.then(function () {
|
||||||
|
done.fail('shall fail since the onPassword callback should throw');
|
||||||
|
return Promise.reject(new Error('loadingTask should be rejected'));
|
||||||
|
}, function (reason) {
|
||||||
|
expect(reason instanceof PasswordException).toEqual(true);
|
||||||
|
expect(reason.code).toEqual(PasswordResponses.INCORRECT_PASSWORD);
|
||||||
|
return passwordIncorrectLoadingTask.destroy();
|
||||||
|
});
|
||||||
|
|
||||||
|
Promise.all([result1, result2]).then(function () {
|
||||||
|
done();
|
||||||
|
}).catch(function (reason) {
|
||||||
|
done.fail(reason);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('PDFWorker', function() {
|
describe('PDFWorker', function() {
|
||||||
if (isNodeJS()) {
|
if (isNodeJS()) {
|
||||||
pending('Worker is not supported in Node.js.');
|
pending('Worker is not supported in Node.js.');
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
/* eslint-disable no-unused-vars */
|
||||||
|
|
||||||
import {
|
import {
|
||||||
AnnotationLayerBuilder, DefaultAnnotationLayerFactory
|
AnnotationLayerBuilder, DefaultAnnotationLayerFactory
|
||||||
@ -25,31 +26,28 @@ import { DownloadManager } from './download_manager.js';
|
|||||||
import { GenericL10n } from './genericl10n.js';
|
import { GenericL10n } from './genericl10n.js';
|
||||||
import { PDFFindController } from './pdf_find_controller.js';
|
import { PDFFindController } from './pdf_find_controller.js';
|
||||||
import { PDFHistory } from './pdf_history.js';
|
import { PDFHistory } from './pdf_history.js';
|
||||||
import pdfjsLib from './pdfjs.js';
|
|
||||||
import { PDFPageView } from './pdf_page_view.js';
|
import { PDFPageView } from './pdf_page_view.js';
|
||||||
import { PDFSinglePageViewer } from './pdf_single_page_viewer';
|
import { PDFSinglePageViewer } from './pdf_single_page_viewer';
|
||||||
import { PDFViewer } from './pdf_viewer.js';
|
import { PDFViewer } from './pdf_viewer.js';
|
||||||
|
|
||||||
let { PDFJS, } = pdfjsLib;
|
const pdfjsVersion = PDFJSDev.eval('BUNDLE_VERSION');
|
||||||
|
const pdfjsBuild = PDFJSDev.eval('BUNDLE_BUILD');
|
||||||
PDFJS.PDFViewer = PDFViewer;
|
|
||||||
PDFJS.PDFSinglePageViewer = PDFSinglePageViewer;
|
|
||||||
PDFJS.PDFPageView = PDFPageView;
|
|
||||||
PDFJS.PDFLinkService = PDFLinkService;
|
|
||||||
PDFJS.SimpleLinkService = SimpleLinkService;
|
|
||||||
PDFJS.TextLayerBuilder = TextLayerBuilder;
|
|
||||||
PDFJS.DefaultTextLayerFactory = DefaultTextLayerFactory;
|
|
||||||
PDFJS.AnnotationLayerBuilder = AnnotationLayerBuilder;
|
|
||||||
PDFJS.DefaultAnnotationLayerFactory = DefaultAnnotationLayerFactory;
|
|
||||||
PDFJS.PDFHistory = PDFHistory;
|
|
||||||
PDFJS.PDFFindController = PDFFindController;
|
|
||||||
PDFJS.EventBus = EventBus;
|
|
||||||
|
|
||||||
PDFJS.DownloadManager = DownloadManager;
|
|
||||||
PDFJS.ProgressBar = ProgressBar;
|
|
||||||
PDFJS.GenericL10n = GenericL10n;
|
|
||||||
PDFJS.NullL10n = NullL10n;
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
PDFJS,
|
PDFViewer,
|
||||||
|
PDFSinglePageViewer,
|
||||||
|
PDFPageView,
|
||||||
|
PDFLinkService,
|
||||||
|
SimpleLinkService,
|
||||||
|
TextLayerBuilder,
|
||||||
|
DefaultTextLayerFactory,
|
||||||
|
AnnotationLayerBuilder,
|
||||||
|
DefaultAnnotationLayerFactory,
|
||||||
|
PDFHistory,
|
||||||
|
PDFFindController,
|
||||||
|
EventBus,
|
||||||
|
DownloadManager,
|
||||||
|
ProgressBar,
|
||||||
|
GenericL10n,
|
||||||
|
NullL10n,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user