mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Merge pull request #17847 from Snuffleupagus/issue-17846
Add better support for /Launch actions with /FileSpec dictionaries (issue 17846)
This commit is contained in:
commit
55db43966e
5 changed files with 38 additions and 9 deletions
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
|
@ -63,6 +63,7 @@
|
|||
!issue7507.pdf
|
||||
!issue6931_reduced.pdf
|
||||
!issue14847.pdf
|
||||
!issue17846.pdf
|
||||
!doc_actions.pdf
|
||||
!issue7580.pdf
|
||||
!issue7598.pdf
|
||||
|
|
BIN
test/pdfs/issue17846.pdf
Normal file
BIN
test/pdfs/issue17846.pdf
Normal file
Binary file not shown.
|
@ -2926,6 +2926,26 @@ describe("api", function () {
|
|||
await loadingTask.destroy();
|
||||
});
|
||||
|
||||
it("gets annotations containing /Launch action with /FileSpec dictionary (issue 17846)", async function () {
|
||||
const loadingTask = getDocument(buildGetDocumentParams("issue17846.pdf"));
|
||||
const pdfDoc = await loadingTask.promise;
|
||||
const pdfPage = await pdfDoc.getPage(1);
|
||||
|
||||
const annotations = await pdfPage.getAnnotations();
|
||||
expect(annotations.length).toEqual(1);
|
||||
|
||||
const { annotationType, url, unsafeUrl, newWindow } = annotations[0];
|
||||
expect(annotationType).toEqual(AnnotationType.LINK);
|
||||
|
||||
expect(url).toBeUndefined();
|
||||
expect(unsafeUrl).toEqual(
|
||||
"对不起/没关系/1_1_模块1行政文件和药品信息目录.pdf"
|
||||
);
|
||||
expect(newWindow).toEqual(true);
|
||||
|
||||
await loadingTask.destroy();
|
||||
});
|
||||
|
||||
it("gets text content", async function () {
|
||||
const { items, styles } = await page.getTextContent();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue