Migrate to Apache PDFBox 3.x

MSAL

Migrates Apache PDFBox 2.x to 3.0, following the PDFBox 3.0 migration guide. It upgrades the PDFBox artifacts, loads documents with Loader, creates the standard 14 fonts with Standard14Fonts.FontName, passes stream cache functions where PDFBox 2 took a MemoryUsageSetting, reads through the new RandomAccessRead implementations, replaces the deprecated APIs that PDFBox 3.0 removed, and embeds the dependencies PDFBox 3 added, such as the new pdfbox-io artifact, in OSGi bundles that embed PDFBox. It runs only in repositories that declare a PDFBox 2.x dependency, use no PDFBox 1.x, and use no library that still asks for PDFBox 2.x, such as Apache Tika 2. PDFBox 3.0 also changes behavior that code doesn't show, such as saving PDFs compressed by default and fixing up AcroForms when they are read, which the migration guide describes.

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

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