Skip to content

Comments

When assembling the text array for an object, skip Forms that don't contain any text, instead of all Forms.#789

Open
rupertj wants to merge 1 commit intosmalot:masterfrom
rupertj:issue/788
Open

When assembling the text array for an object, skip Forms that don't contain any text, instead of all Forms.#789
rupertj wants to merge 1 commit intosmalot:masterfrom
rupertj:issue/788

Conversation

@rupertj
Copy link
Contributor

@rupertj rupertj commented Feb 6, 2026

Fix for #788.

@k00ni
Copy link
Collaborator

k00ni commented Feb 9, 2026

Thank you @rupertj.

  • Could you add a few tests which cover this change? At least one would be great. If you need help, let me know.

@k00ni k00ni linked an issue Feb 9, 2026 that may be closed by this pull request
@k00ni k00ni added missing or incomplete functionality For something which is not a bug, but more like an incomplete feature. fix labels Feb 9, 2026

// If the PDFObject is a Form and doesn't have any text,
// skip it.
if (($xobject instanceof Form) && ($objectText === ' ')) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (($xobject instanceof Form) && ($objectText === ' ')) {
if ($xobject instanceof Form && $objectText === ' ') {

No parentheses required when using a combination of simple checks.

@k00ni
Copy link
Collaborator

k00ni commented Feb 16, 2026

@gerardnll + @MrMitch Could you please test if it solves your issues in #788 and give me feedback? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix missing or incomplete functionality For something which is not a bug, but more like an incomplete feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Page getText() returns blank contents

2 participants