Merge pull request #8865 from Snuffleupagus/hide-unsupported-LinkAnnotation
Hide unsupported `LinkAnnotation`s (issue 3897)
This commit is contained in:
commit
437e9cb056
@ -251,7 +251,9 @@ class AnnotationElement {
|
|||||||
|
|
||||||
class LinkAnnotationElement extends AnnotationElement {
|
class LinkAnnotationElement extends AnnotationElement {
|
||||||
constructor(parameters) {
|
constructor(parameters) {
|
||||||
super(parameters, /* isRenderable = */ true);
|
let isRenderable = !!(parameters.data.url || parameters.data.dest ||
|
||||||
|
parameters.data.action);
|
||||||
|
super(parameters, isRenderable);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -89,6 +89,7 @@
|
|||||||
!simpletype3font.pdf
|
!simpletype3font.pdf
|
||||||
!sizes.pdf
|
!sizes.pdf
|
||||||
!javauninstall-7r.pdf
|
!javauninstall-7r.pdf
|
||||||
|
!file_url_link.pdf
|
||||||
!multiple-filters-length-zero.pdf
|
!multiple-filters-length-zero.pdf
|
||||||
!non-embedded-NuptialScript.pdf
|
!non-embedded-NuptialScript.pdf
|
||||||
!issue3205r.pdf
|
!issue3205r.pdf
|
||||||
|
85
test/pdfs/file_url_link.pdf
Normal file
85
test/pdfs/file_url_link.pdf
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
%PDF-1.7
|
||||||
|
%âãÏÓ
|
||||||
|
1 0 obj
|
||||||
|
<<
|
||||||
|
/Pages 2 0 R
|
||||||
|
/Type /Catalog
|
||||||
|
>>
|
||||||
|
endobj
|
||||||
|
2 0 obj
|
||||||
|
<<
|
||||||
|
/Kids [3 0 R]
|
||||||
|
/Count 1
|
||||||
|
/Type /Pages
|
||||||
|
>>
|
||||||
|
endobj
|
||||||
|
3 0 obj
|
||||||
|
<<
|
||||||
|
/Parent 2 0 R
|
||||||
|
/Annots [4 0 R]
|
||||||
|
/MediaBox [0 0 200 50]
|
||||||
|
/Resources
|
||||||
|
<<
|
||||||
|
/Font
|
||||||
|
<<
|
||||||
|
/F1 5 0 R
|
||||||
|
>>
|
||||||
|
>>
|
||||||
|
/Contents 6 0 R
|
||||||
|
/Type /Page
|
||||||
|
>>
|
||||||
|
endobj
|
||||||
|
4 0 obj
|
||||||
|
<<
|
||||||
|
/Border [0 0 1]
|
||||||
|
/Subtype /Link
|
||||||
|
/C [0 1 0]
|
||||||
|
/A
|
||||||
|
<<
|
||||||
|
/URI (file://path/to/local/file.pdf)
|
||||||
|
/Type /Action
|
||||||
|
/S /URI
|
||||||
|
>>
|
||||||
|
/Type /Annot
|
||||||
|
/Rect [5 10 180 40]
|
||||||
|
>>
|
||||||
|
endobj
|
||||||
|
5 0 obj
|
||||||
|
<<
|
||||||
|
/BaseFont /Times-Roman
|
||||||
|
/Subtype /Type1
|
||||||
|
/Encoding /WinAnsiEncoding
|
||||||
|
/Type /Font
|
||||||
|
>>
|
||||||
|
endobj
|
||||||
|
6 0 obj
|
||||||
|
<<
|
||||||
|
/Length 62
|
||||||
|
>>
|
||||||
|
stream
|
||||||
|
1 0 0 rg
|
||||||
|
BT
|
||||||
|
10 20 TD
|
||||||
|
/F1 20 Tf
|
||||||
|
(path/to/local/file.pdf) Tj
|
||||||
|
ET
|
||||||
|
|
||||||
|
endstream
|
||||||
|
endobj xref
|
||||||
|
0 7
|
||||||
|
0000000000 65535 f
|
||||||
|
0000000015 00000 n
|
||||||
|
0000000066 00000 n
|
||||||
|
0000000125 00000 n
|
||||||
|
0000000270 00000 n
|
||||||
|
0000000437 00000 n
|
||||||
|
0000000538 00000 n
|
||||||
|
trailer
|
||||||
|
|
||||||
|
<<
|
||||||
|
/Root 1 0 R
|
||||||
|
/Size 7
|
||||||
|
>>
|
||||||
|
startxref
|
||||||
|
652
|
||||||
|
%%EOF
|
@ -623,6 +623,15 @@
|
|||||||
"annotations": true,
|
"annotations": true,
|
||||||
"about": "Annotation with Rect array containing indirect objects."
|
"about": "Annotation with Rect array containing indirect objects."
|
||||||
},
|
},
|
||||||
|
{ "id": "file_url_link",
|
||||||
|
"file": "pdfs/file_url_link.pdf",
|
||||||
|
"md5": "b0253c96c38d43bc49259bbf36db938a",
|
||||||
|
"link": false,
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "eq",
|
||||||
|
"annotations": true,
|
||||||
|
"about": "Annotation with (unsupported) file:// URL."
|
||||||
|
},
|
||||||
{ "id": "issue4934",
|
{ "id": "issue4934",
|
||||||
"file": "pdfs/issue4934.pdf",
|
"file": "pdfs/issue4934.pdf",
|
||||||
"md5": "6099da44f677702ae65a648b51a2226d",
|
"md5": "6099da44f677702ae65a648b51a2226d",
|
||||||
|
@ -658,8 +658,10 @@ let PDFViewerApplication = {
|
|||||||
this.setTitleUsingUrl(file.originalUrl);
|
this.setTitleUsingUrl(file.originalUrl);
|
||||||
parameters.url = file.url;
|
parameters.url = file.url;
|
||||||
}
|
}
|
||||||
if (typeof PDFJSDev !== 'undefined' &&
|
if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION')) {
|
||||||
PDFJSDev.test('FIREFOX || MOZCENTRAL || CHROME')) {
|
parameters.docBaseUrl = document.URL.split('#')[0];
|
||||||
|
} else if (typeof PDFJSDev !== 'undefined' &&
|
||||||
|
PDFJSDev.test('FIREFOX || MOZCENTRAL || CHROME')) {
|
||||||
parameters.docBaseUrl = this.baseUrl;
|
parameters.docBaseUrl = this.baseUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user