Make an effort to adhere the spec 7.6.3.2

This commit is contained in:
vyv03354 2013-02-02 02:09:12 +09:00
parent 43d6c6f1ab
commit 724add2ffd
3 changed files with 5 additions and 2 deletions

View File

@ -295,7 +295,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
}
var gfx = new CanvasGraphics(params.canvasContext, this.commonObjs,
this.objs, params.textLayer);
this.objs, !this.pageInfo.disableTextLayer && params.textLayer);
try {
this.display(gfx, params.viewport, complete, continueCallback);
} catch (e) {

View File

@ -560,6 +560,7 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
var ownerPassword = stringToBytes(dict.get('O'));
var userPassword = stringToBytes(dict.get('U'));
var flags = dict.get('P');
this.disableTextLayer = !(flags & 16);
var revision = dict.get('R');
var encryptMetadata = algorithm == 4 && // meaningful when V is 4
dict.get('EncryptMetadata') !== false; // makes true as default value

View File

@ -212,11 +212,13 @@ var WorkerMessageHandler = {
handler.on('GetPageRequest', function wphSetupGetPage(data) {
var pageNumber = data.pageIndex + 1;
var pdfPage = pdfModel.getPage(pageNumber);
var encrypt = pdfModel.xref.encrypt;
var page = {
pageIndex: data.pageIndex,
rotate: pdfPage.rotate,
ref: pdfPage.ref,
view: pdfPage.view
view: pdfPage.view,
disableTextLayer: encrypt ? encrypt.disableTextLayer : false
};
handler.send('GetPage', {pageInfo: page});
});