Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -2982,7 +2982,7 @@ class PartialEvaluator {
currentTextState !== textState &&
(currentTextState.fontSize !== textState.fontSize ||
(currentTextState.fontName !== textState.fontName &&
(currentTextState.font.name !== textState.font.name ||
(currentTextState.font?.name !== textState.font.name ||
currentTextState.font.vertical !== textState.font.vertical)))
) {
flushTextContentItem();
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
!issue14023.pdf
!issue14438.pdf
!issue14999_reduced.pdf
!issue22381.pdf
!bad-PageLabels.pdf
!decodeACSuccessive.pdf
!issue13003.pdf
Expand Down
Binary file added test/pdfs/issue22381.pdf
Binary file not shown.
13 changes: 13 additions & 0 deletions test/unit/api_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5600,6 +5600,19 @@ have written that much by now. So, here’s to squashing bugs.`);
await loadingTask.destroy();
});

it("gets text content with zero initial font size (issue 22381)", async function () {
const loadingTask = getDocument(buildGetDocumentParams("issue22381.pdf"));
const pdfDoc = await loadingTask.promise;
const pdfPage = await pdfDoc.getPage(1);
const { items } = await pdfPage.getTextContent({
disableNormalization: true,
});
const text = mergeText(items);
expect(text).toEqual("hiddenVisible text");

await loadingTask.destroy();
});

it("gets empty structure tree", async function () {
const tree = await page.getStructTree();

Expand Down
Loading