1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 17:48:07 +02:00

Improved annotations' display/behavior.

Added an "InteractiveAnnotation" class to homogenize the annotations' structure (highlighting) and user interactions (for now, used for text and link annotations).

Text annotations:
The appearance (AP) has priority over the icon (Name).
The popup extends horizontally (up to a limit) as well as vertically.
Reduced the title's font size.
The annotation's color (C) is used to color the popup's background.
On top of the mouseover show/hide behavior, a click on the icon will lock the annotation open (for mobile purposes). It can be closed with another click on either the icon or the popup.

An annotation printing is conditioned by its "print" bit
Unsupported annotations are not displayed at all.
This commit is contained in:
Samuel Chantaraud 2014-03-07 10:48:42 -04:00
parent 3e931048f2
commit 076b3433b4
8 changed files with 305 additions and 131 deletions

View file

@ -134,7 +134,7 @@ var Page = (function PageClosure() {
}.bind(this));
return promise;
},
getOperatorList: function Page_getOperatorList(handler) {
getOperatorList: function Page_getOperatorList(handler, intent) {
var self = this;
var promise = new LegacyPromise();
@ -169,11 +169,12 @@ var Page = (function PageClosure() {
var contentStream = data[0];
var opList = new OperatorList(handler, self.pageIndex);
var opList = new OperatorList(intent, handler, self.pageIndex);
handler.send('StartRenderPage', {
transparency: partialEvaluator.hasBlendModes(self.resources),
pageIndex: self.pageIndex
pageIndex: self.pageIndex,
intent: intent
});
partialEvaluator.getOperatorList(contentStream, self.resources, opList);
pageListPromise.resolve(opList);
@ -191,7 +192,7 @@ var Page = (function PageClosure() {
}
var annotationsReadyPromise = Annotation.appendToOperatorList(
annotations, pageOpList, pdfManager, partialEvaluator);
annotations, pageOpList, pdfManager, partialEvaluator, intent);
annotationsReadyPromise.then(function () {
pageOpList.flush(true);
promise.resolve(pageOpList);