mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 01:58:06 +02:00
Initial API refectoring
This commit is contained in:
parent
d61c4f07f8
commit
73cab9c302
3 changed files with 391 additions and 383 deletions
|
@ -89,6 +89,27 @@ var WorkerMessageHandler = {
|
|||
// Create only the model of the PDFDoc, which is enough for
|
||||
// processing the content of the pdf.
|
||||
pdfModel = new PDFDocModel(new Stream(data));
|
||||
var doc = {
|
||||
numPages: pdfModel.numPages,
|
||||
fingerprint: pdfModel.fingerprint,
|
||||
destinations: pdfModel.catalog.destinations,
|
||||
outline: pdfModel.catalog.documentOutline,
|
||||
info: pdfModel.info,
|
||||
metadata: pdfModel.catalog.metadata
|
||||
};
|
||||
handler.send('doc', {pdfInfo: doc});
|
||||
});
|
||||
|
||||
handler.on('getpage', function wphSetupTest(data) {
|
||||
var pdfPage = pdfModel.getPage(data.pageNumber);
|
||||
var page = {
|
||||
pageNumber: data.pageNumber,
|
||||
rotate: pdfPage.rotate,
|
||||
ref: pdfPage.ref,
|
||||
view: pdfPage.view,
|
||||
annotations: pdfPage.getAnnotations(), // REMOVE
|
||||
};
|
||||
handler.send('getpage', {pageInfo: page});
|
||||
});
|
||||
|
||||
handler.on('page_request', function wphSetupPageRequest(pageNum) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue