mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Text annotations must use their own canvas when their appearance is generated (bug 1844576)
When a pdf has /NeedAppearances set to true, the annotation appearance must be generated from its value and we must take into account the hasOwnCanvas property.
This commit is contained in:
parent
2a508b95e1
commit
9277801493
4 changed files with 68 additions and 2 deletions
|
@ -1852,6 +1852,10 @@ class WidgetAnnotation extends Annotation {
|
|||
return { opList, separateForm: false, separateCanvas: false };
|
||||
}
|
||||
|
||||
const isUsingOwnCanvas = !!(
|
||||
this.data.hasOwnCanvas && intent & RenderingIntentFlag.DISPLAY
|
||||
);
|
||||
|
||||
const matrix = [1, 0, 0, 1, 0, 0];
|
||||
const bbox = [
|
||||
0,
|
||||
|
@ -1877,7 +1881,7 @@ class WidgetAnnotation extends Annotation {
|
|||
this.data.rect,
|
||||
transform,
|
||||
this.getRotationMatrix(annotationStorage),
|
||||
/* isUsingOwnCanvas = */ false,
|
||||
isUsingOwnCanvas,
|
||||
]);
|
||||
|
||||
const stream = new StringStream(content);
|
||||
|
@ -1892,7 +1896,7 @@ class WidgetAnnotation extends Annotation {
|
|||
if (optionalContent !== undefined) {
|
||||
opList.addOp(OPS.endMarkedContent, []);
|
||||
}
|
||||
return { opList, separateForm: false, separateCanvas: false };
|
||||
return { opList, separateForm: false, separateCanvas: isUsingOwnCanvas };
|
||||
}
|
||||
|
||||
_getMKDict(rotation) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue