mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-24 09:08:07 +02:00
Support encoded dest-strings in /GoTo destination dictionaries (issue 14864)
Interestingly enough this appears to be the very first case of *encoded* dest-strings, in /GoTo destination dictionaries, that we've actually come across. What's really fascinating is that it's less than a week after issue 14847, given that these issues are *somewhat* similar.
This commit is contained in:
parent
397f71424c
commit
df5a4fd0a7
4 changed files with 38 additions and 1 deletions
1
test/pdfs/issue14864.pdf.link
Normal file
1
test/pdfs/issue14864.pdf.link
Normal file
|
@ -0,0 +1 @@
|
|||
https://github.com/mozilla/pdf.js/files/8599802/songbook.pdf
|
|
@ -6,6 +6,13 @@
|
|||
"link": true,
|
||||
"type": "other"
|
||||
},
|
||||
{ "id": "issue14864",
|
||||
"file": "pdfs/issue14864.pdf",
|
||||
"md5": "cfe5e68267d1e84ec909a915911974cf",
|
||||
"rounds": 1,
|
||||
"link": true,
|
||||
"type": "other"
|
||||
},
|
||||
{ "id": "filled-background-range",
|
||||
"file": "pdfs/filled-background.pdf",
|
||||
"md5": "2e3120255d9c3e79b96d2543b12d2589",
|
||||
|
|
|
@ -1454,6 +1454,33 @@ describe("api", function () {
|
|||
await loadingTask.destroy();
|
||||
});
|
||||
|
||||
it("gets outline, with dest-strings using PDFDocEncoding (issue 14864)", async function () {
|
||||
if (isNodeJS) {
|
||||
pending("Linked test-cases are not supported in Node.js.");
|
||||
}
|
||||
const loadingTask = getDocument(buildGetDocumentParams("issue14864.pdf"));
|
||||
const pdfDoc = await loadingTask.promise;
|
||||
const outline = await pdfDoc.getOutline();
|
||||
|
||||
expect(Array.isArray(outline)).toEqual(true);
|
||||
expect(outline.length).toEqual(6);
|
||||
|
||||
expect(outline[4]).toEqual({
|
||||
dest: "Händel -- Halle🎆lujah",
|
||||
url: null,
|
||||
unsafeUrl: undefined,
|
||||
newWindow: undefined,
|
||||
title: "Händel -- Halle🎆lujah",
|
||||
color: new Uint8ClampedArray([0, 0, 0]),
|
||||
count: undefined,
|
||||
bold: false,
|
||||
italic: false,
|
||||
items: [],
|
||||
});
|
||||
|
||||
await loadingTask.destroy();
|
||||
});
|
||||
|
||||
it("gets outline with non-displayable chars", async function () {
|
||||
const loadingTask = getDocument(buildGetDocumentParams("issue14267.pdf"));
|
||||
const pdfDoc = await loadingTask.promise;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue