Merge pull request #15026 from Snuffleupagus/rm-unused-annotation-ops
[api-minor] Stop using the `beginAnnotations`/`endAnnotations` operators (PR 14998 follow-up)
This commit is contained in:
commit
7f4b1c2149
@ -19,7 +19,6 @@ import {
|
|||||||
info,
|
info,
|
||||||
InvalidPDFException,
|
InvalidPDFException,
|
||||||
isArrayEqual,
|
isArrayEqual,
|
||||||
OPS,
|
|
||||||
PageActionEventType,
|
PageActionEventType,
|
||||||
RenderingIntentFlag,
|
RenderingIntentFlag,
|
||||||
shadow,
|
shadow,
|
||||||
@ -467,11 +466,9 @@ class Page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Promise.all(opListPromises).then(function (opLists) {
|
return Promise.all(opListPromises).then(function (opLists) {
|
||||||
pageOpList.addOp(OPS.beginAnnotations, []);
|
|
||||||
for (const opList of opLists) {
|
for (const opList of opLists) {
|
||||||
pageOpList.addOpList(opList);
|
pageOpList.addOpList(opList);
|
||||||
}
|
}
|
||||||
pageOpList.addOp(OPS.endAnnotations, []);
|
|
||||||
pageOpList.flush(true);
|
pageOpList.flush(true);
|
||||||
return { length: pageOpList.totalLength };
|
return { length: pageOpList.totalLength };
|
||||||
});
|
});
|
||||||
|
@ -2976,10 +2976,6 @@ class CanvasGraphics {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
beginAnnotations() {}
|
|
||||||
|
|
||||||
endAnnotations() {}
|
|
||||||
|
|
||||||
beginAnnotation(id, rect, transform, matrix, hasOwnCanvas) {
|
beginAnnotation(id, rect, transform, matrix, hasOwnCanvas) {
|
||||||
// The annotations are drawn just after the page content.
|
// The annotations are drawn just after the page content.
|
||||||
// The page content drawing can potentially have set a transform,
|
// The page content drawing can potentially have set a transform,
|
||||||
|
@ -337,7 +337,9 @@ const OPS = {
|
|||||||
paintFormXObjectEnd: 75,
|
paintFormXObjectEnd: 75,
|
||||||
beginGroup: 76,
|
beginGroup: 76,
|
||||||
endGroup: 77,
|
endGroup: 77,
|
||||||
|
/** @deprecated unused */
|
||||||
beginAnnotations: 78,
|
beginAnnotations: 78,
|
||||||
|
/** @deprecated unused */
|
||||||
endAnnotations: 79,
|
endAnnotations: 79,
|
||||||
beginAnnotation: 80,
|
beginAnnotation: 80,
|
||||||
endAnnotation: 81,
|
endAnnotation: 81,
|
||||||
|
@ -2443,15 +2443,15 @@ Caron Broadcasting, Inc., an Ohio corporation (“Lessee”).`)
|
|||||||
const opListAnnotEnable = await pdfPage.getOperatorList({
|
const opListAnnotEnable = await pdfPage.getOperatorList({
|
||||||
annotationMode: AnnotationMode.ENABLE,
|
annotationMode: AnnotationMode.ENABLE,
|
||||||
});
|
});
|
||||||
expect(opListAnnotEnable.fnArray.length).toBeGreaterThan(150);
|
expect(opListAnnotEnable.fnArray.length).toBeGreaterThan(140);
|
||||||
expect(opListAnnotEnable.argsArray.length).toBeGreaterThan(150);
|
expect(opListAnnotEnable.argsArray.length).toBeGreaterThan(140);
|
||||||
expect(opListAnnotEnable.lastChunk).toEqual(true);
|
expect(opListAnnotEnable.lastChunk).toEqual(true);
|
||||||
|
|
||||||
const opListAnnotEnableForms = await pdfPage.getOperatorList({
|
const opListAnnotEnableForms = await pdfPage.getOperatorList({
|
||||||
annotationMode: AnnotationMode.ENABLE_FORMS,
|
annotationMode: AnnotationMode.ENABLE_FORMS,
|
||||||
});
|
});
|
||||||
expect(opListAnnotEnableForms.fnArray.length).toBeGreaterThan(40);
|
expect(opListAnnotEnableForms.fnArray.length).toBeGreaterThan(30);
|
||||||
expect(opListAnnotEnableForms.argsArray.length).toBeGreaterThan(40);
|
expect(opListAnnotEnableForms.argsArray.length).toBeGreaterThan(30);
|
||||||
expect(opListAnnotEnableForms.lastChunk).toEqual(true);
|
expect(opListAnnotEnableForms.lastChunk).toEqual(true);
|
||||||
|
|
||||||
const opListAnnotEnableStorage = await pdfPage.getOperatorList({
|
const opListAnnotEnableStorage = await pdfPage.getOperatorList({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user