mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Implemented Comment and Check annotation. Correcting some typos in last commit
This commit is contained in:
parent
ca7d44c646
commit
4a661e1735
5 changed files with 96 additions and 3 deletions
18
src/core.js
18
src/core.js
|
@ -323,10 +323,10 @@ var Page = (function PageClosure() {
|
|||
if (a) {
|
||||
switch (a.get('S').name) {
|
||||
case 'URI':
|
||||
link.url = a.get('URI');
|
||||
item.url = a.get('URI');
|
||||
break;
|
||||
case 'GoTo':
|
||||
link.dest = a.get('D');
|
||||
item.dest = a.get('D');
|
||||
break;
|
||||
default:
|
||||
TODO('other link types');
|
||||
|
@ -334,7 +334,7 @@ var Page = (function PageClosure() {
|
|||
} else if (annotation.has('Dest')) {
|
||||
// simple destination link
|
||||
var dest = annotation.get('Dest');
|
||||
link.dest = isName(dest) ? dest.name : dest;
|
||||
item.dest = isName(dest) ? dest.name : dest;
|
||||
}
|
||||
break;
|
||||
case 'Widget':
|
||||
|
@ -379,6 +379,18 @@ var Page = (function PageClosure() {
|
|||
item.textAlignment = getInheritableProperty(annotation, 'Q');
|
||||
item.flags = getInheritableProperty(annotation, 'Ff') || 0;
|
||||
break;
|
||||
|
||||
case 'Text':
|
||||
var content = annotation.get('Contents');
|
||||
var title = annotation.get('T');
|
||||
item.content = (typeof content == 'string') ? stringToPDFString(content) : null;
|
||||
item.title = (typeof title == 'string') ? stringToPDFString(title) : null;
|
||||
item.name = annotation.get('Name').name;
|
||||
break;
|
||||
|
||||
default:
|
||||
TODO('unimplemented annotation type: ' + subtype.name);
|
||||
break;
|
||||
}
|
||||
items.push(item);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue