mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Merge pull request #16186 from Snuffleupagus/issue-16176
Support multi-byte ToUnicode entries, when using predefined CMaps (issue 16176)
This commit is contained in:
commit
9321758d91
4 changed files with 27 additions and 4 deletions
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
|
@ -118,6 +118,7 @@
|
|||
!issue6127.pdf
|
||||
!issue7891_bc0.pdf
|
||||
!issue11242_reduced.pdf
|
||||
!issue16176.pdf
|
||||
!issue11279.pdf
|
||||
!issue11362.pdf
|
||||
!issue13325_reduced.pdf
|
||||
|
|
BIN
test/pdfs/issue16176.pdf
Normal file
BIN
test/pdfs/issue16176.pdf
Normal file
Binary file not shown.
|
@ -29,6 +29,7 @@ import {
|
|||
} from "../../src/shared/util.js";
|
||||
import {
|
||||
buildGetDocumentParams,
|
||||
CMAP_URL,
|
||||
DefaultFileReaderFactory,
|
||||
TEST_PDFS_PATH,
|
||||
} from "./test_utils.js";
|
||||
|
@ -2623,6 +2624,23 @@ Caron Broadcasting, Inc., an Ohio corporation (“Lessee”).`)
|
|||
await loadingTask.destroy();
|
||||
});
|
||||
|
||||
it("gets text content with multi-byte entries, using predefined CMaps (issue 16176)", async function () {
|
||||
const loadingTask = getDocument(
|
||||
buildGetDocumentParams("issue16176.pdf", {
|
||||
cMapUrl: CMAP_URL,
|
||||
useWorkerFetch: false,
|
||||
})
|
||||
);
|
||||
const pdfDoc = await loadingTask.promise;
|
||||
const pdfPage = await pdfDoc.getPage(1);
|
||||
const { items } = await pdfPage.getTextContent();
|
||||
const text = mergeText(items);
|
||||
|
||||
expect(text).toEqual("𠮷");
|
||||
|
||||
await loadingTask.destroy();
|
||||
});
|
||||
|
||||
it("gets empty structure tree", async function () {
|
||||
const tree = await page.getStructTree();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue