1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 09:38:06 +02:00

Merge pull request #14182 from calixteman/richtext

Support rich content in markup annotation
This commit is contained in:
Jonas Jenwald 2021-10-31 14:41:56 +01:00 committed by GitHub
commit 8c70258065
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 188 additions and 39 deletions

View file

@ -55,6 +55,7 @@ import { ObjectLoader } from "./object_loader.js";
import { OperatorList } from "./operator_list.js";
import { StringStream } from "./stream.js";
import { writeDict } from "./writer.js";
import { XFAFactory } from "./xfa/factory.js";
class AnnotationFactory {
/**
@ -1105,6 +1106,10 @@ class MarkupAnnotation extends Annotation {
this.data.color = null;
}
}
if (dict.has("RC")) {
this.data.richText = XFAFactory.getRichTextAsHtml(dict.get("RC"));
}
}
/**
@ -2552,6 +2557,10 @@ class PopupAnnotation extends Annotation {
this.setContents(parentItem.get("Contents"));
this.data.contentsObj = this._contents;
if (parentItem.has("RC")) {
this.data.richText = XFAFactory.getRichTextAsHtml(parentItem.get("RC"));
}
}
}