mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 09:38:06 +02:00
Support rich content in markup annotation
- use the xfa parser but in the xhtml namespace.
This commit is contained in:
parent
0e7614df7f
commit
cf8dc750d6
14 changed files with 188 additions and 39 deletions
|
@ -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 {
|
||||
/**
|
||||
|
@ -1098,6 +1099,10 @@ class MarkupAnnotation extends Annotation {
|
|||
this.data.color = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (dict.has("RC")) {
|
||||
this.data.richText = XFAFactory.getRichTextAsHtml(dict.get("RC"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2545,6 +2550,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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue