mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 23:28:06 +02:00
Implement support for Popup annotations
Most code for Popup annotations is already present for Text annotations. This patch extracts the popup creation logic from the Text annotation code so it can be reused for Popup annotations. Not only does this add support for Popup annotations, the Text annotation code is also considerably easier. If a `Popup` entry is available for a Text annotation, it will not be more than an image. The popup will be handled by the Popup annotation. However, it is also possible for Text annotations to not have a separate Popup annotation, in which case the Text annotation handles the popup creation itself.
This commit is contained in:
parent
05b9d3730a
commit
7d43971f54
8 changed files with 302 additions and 148 deletions
|
@ -39,35 +39,37 @@
|
|||
box-shadow: 0px 2px 10px #ff0;
|
||||
}
|
||||
|
||||
.annotationLayer .annotText > img {
|
||||
.annotationLayer .textAnnotation img {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.annotationLayer .annotTextContentWrapper {
|
||||
.annotationLayer .popupWrapper {
|
||||
position: absolute;
|
||||
width: 20em;
|
||||
}
|
||||
|
||||
.annotationLayer .annotTextContent {
|
||||
.annotationLayer .popup {
|
||||
position: absolute;
|
||||
z-index: 200;
|
||||
float: left;
|
||||
max-width: 20em;
|
||||
background-color: #FFFF99;
|
||||
box-shadow: 0px 2px 5px #333;
|
||||
border-radius: 2px;
|
||||
padding: 0.6em;
|
||||
margin-left: 5px;
|
||||
display: block !important;
|
||||
font: message-box;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.annotationLayer .annotTextContent > h1 {
|
||||
.annotationLayer .popup h1 {
|
||||
font-size: 1em;
|
||||
border-bottom: 1px solid #000000;
|
||||
margin: 0;
|
||||
padding: 0 0 0.2em 0;
|
||||
}
|
||||
|
||||
.annotationLayer .annotTextContent > p {
|
||||
.annotationLayer .popup p {
|
||||
margin: 0;
|
||||
padding: 0.2em 0 0 0;
|
||||
}
|
||||
|
|
2
test/pdfs/.gitignore
vendored
2
test/pdfs/.gitignore
vendored
|
@ -198,3 +198,5 @@
|
|||
!issue6108.pdf
|
||||
!issue6113.pdf
|
||||
!openoffice.pdf
|
||||
!annotation-link-text-popup.pdf
|
||||
!annotation-text-without-popup.pdf
|
||||
|
|
BIN
test/pdfs/annotation-link-text-popup.pdf
Normal file
BIN
test/pdfs/annotation-link-text-popup.pdf
Normal file
Binary file not shown.
BIN
test/pdfs/annotation-text-without-popup.pdf
Normal file
BIN
test/pdfs/annotation-text-without-popup.pdf
Normal file
Binary file not shown.
|
@ -2616,6 +2616,21 @@
|
|||
"rounds": 1,
|
||||
"type": "load"
|
||||
},
|
||||
{ "id": "annotation-link-text-popup",
|
||||
"file": "pdfs/annotation-link-text-popup.pdf",
|
||||
"md5": "4bbf56e81d47232de5f305124ab0ba27",
|
||||
"rounds": 1,
|
||||
"type": "eq",
|
||||
"annotations": true
|
||||
},
|
||||
{ "id": "annotation-text-without-popup",
|
||||
"file": "pdfs/annotation-text-without-popup.pdf",
|
||||
"md5": "7c2d241babe00139e34b9f8369a909eb",
|
||||
"rounds": 1,
|
||||
"type": "eq",
|
||||
"annotations": true,
|
||||
"about": "Text annotation without a separate Popup annotation"
|
||||
},
|
||||
{ "id": "issue6108",
|
||||
"file": "pdfs/issue6108.pdf",
|
||||
"md5": "8961cb55149495989a80bf0487e0f076",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue