1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 14:48:08 +02:00

Merge pull request #17908 from calixteman/issue17906

Don't render annotations with a null dimension
This commit is contained in:
calixteman 2024-04-10 09:33:30 +02:00 committed by GitHub
commit 2c7ae50c4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 25 additions and 5 deletions

View file

@ -1119,11 +1119,20 @@ class Annotation {
renderForms,
annotationStorage
) {
const data = this.data;
const { hasOwnCanvas, id, rect } = this.data;
let appearance = this.appearance;
const isUsingOwnCanvas = !!(
this.data.hasOwnCanvas && intent & RenderingIntentFlag.DISPLAY
hasOwnCanvas && intent & RenderingIntentFlag.DISPLAY
);
if (isUsingOwnCanvas && (rect[0] === rect[2] || rect[1] === rect[3])) {
// Empty annotation, don't draw anything.
this.data.hasOwnCanvas = false;
return {
opList: new OperatorList(),
separateForm: false,
separateCanvas: false,
};
}
if (!appearance) {
if (!isUsingOwnCanvas) {
return {
@ -1143,7 +1152,7 @@ class Annotation {
);
const bbox = appearanceDict.getArray("BBox") || [0, 0, 1, 1];
const matrix = appearanceDict.getArray("Matrix") || [1, 0, 0, 1, 0, 0];
const transform = getTransformMatrix(data.rect, bbox, matrix);
const transform = getTransformMatrix(rect, bbox, matrix);
const opList = new OperatorList();
@ -1159,8 +1168,8 @@ class Annotation {
}
opList.addOp(OPS.beginAnnotation, [
data.id,
data.rect,
id,
rect,
transform,
matrix,
isUsingOwnCanvas,

View file

@ -0,0 +1 @@
https://web.archive.org/web/20240408171222/https://www.myconsumers.org/docs/default-source/default-document-library/consumer_fee_schedule3cb1f27b220b46e38278186d8f609a23fc8e3ea533ad421d8caf5ccbd8df1cb5.pdf

View file

@ -9823,5 +9823,15 @@
"md5": "07d95eabf18aee0cf38f09eb7b1390ec",
"rounds": 1,
"type": "eq"
},
{
"id": "issue17906",
"file": "pdfs/issue17906.pdf",
"md5": "f81c617e5113e0c510a4cfe8b012798e",
"rounds": 1,
"link": true,
"firstPage": 1,
"lastPage": 1,
"type": "eq"
}
]