Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[api-minor] Stop using the beginAnnotations/endAnnotations operators (PR 14998 follow-up) #15026

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/core/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
info,
InvalidPDFException,
isArrayEqual,
OPS,
PageActionEventType,
RenderingIntentFlag,
shadow,
Expand Down Expand Up @@ -467,11 +466,9 @@ class Page {
}

return Promise.all(opListPromises).then(function (opLists) {
pageOpList.addOp(OPS.beginAnnotations, []);
for (const opList of opLists) {
pageOpList.addOpList(opList);
}
pageOpList.addOp(OPS.endAnnotations, []);
pageOpList.flush(true);
return { length: pageOpList.totalLength };
});
Expand Down
4 changes: 0 additions & 4 deletions src/display/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -2976,10 +2976,6 @@ class CanvasGraphics {
}
}

beginAnnotations() {}

endAnnotations() {}

beginAnnotation(id, rect, transform, matrix, hasOwnCanvas) {
// The annotations are drawn just after the page content.
// The page content drawing can potentially have set a transform,
Expand Down
2 changes: 2 additions & 0 deletions src/shared/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,9 @@ const OPS = {
paintFormXObjectEnd: 75,
beginGroup: 76,
endGroup: 77,
/** @deprecated unused */
beginAnnotations: 78,
/** @deprecated unused */
endAnnotations: 79,
beginAnnotation: 80,
endAnnotation: 81,
Expand Down
8 changes: 4 additions & 4 deletions test/unit/api_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2443,15 +2443,15 @@ Caron Broadcasting, Inc., an Ohio corporation (“Lessee”).`)
const opListAnnotEnable = await pdfPage.getOperatorList({
annotationMode: AnnotationMode.ENABLE,
});
expect(opListAnnotEnable.fnArray.length).toBeGreaterThan(150);
expect(opListAnnotEnable.argsArray.length).toBeGreaterThan(150);
expect(opListAnnotEnable.fnArray.length).toBeGreaterThan(140);
expect(opListAnnotEnable.argsArray.length).toBeGreaterThan(140);
expect(opListAnnotEnable.lastChunk).toEqual(true);

const opListAnnotEnableForms = await pdfPage.getOperatorList({
annotationMode: AnnotationMode.ENABLE_FORMS,
});
expect(opListAnnotEnableForms.fnArray.length).toBeGreaterThan(40);
expect(opListAnnotEnableForms.argsArray.length).toBeGreaterThan(40);
expect(opListAnnotEnableForms.fnArray.length).toBeGreaterThan(30);
expect(opListAnnotEnableForms.argsArray.length).toBeGreaterThan(30);
expect(opListAnnotEnableForms.lastChunk).toEqual(true);

const opListAnnotEnableStorage = await pdfPage.getOperatorList({
Expand Down