Use the result of PDFParser.parse() and PDFStreamParser.parse()

MSAL

In PDFBox 3.0 PDFParser.parse() returns the PDDocument and PDFStreamParser.parse() returns the tokens, and the getPDDocument(), getDocument() and getTokens() methods that returned them after a parse are gone. Where a statement calls parse() on a local parser and the statements after it use the parser only to get the result, this parses where the next statement gets the result, as in PDDocument document = parser.parse(), or else declares a variable for the result where the code parsed, and uses the variable where the result is got.

org.openrewrite.apache.pdfbox.MigrateParserResults
mod run . --recipe=org.openrewrite.apache.pdfbox.MigrateParserResults

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.