Load PDF and FDF documents with Loader

MSAL

PDFBox 3.0 removed the static load methods of PDDocument and FDFDocument. This replaces each with the Loader.loadPDF, Loader.loadFDF or Loader.loadXFDF method that takes the same arguments. A PDF read from an InputStream is read into a RandomAccessReadBuffer, as Loader takes no stream, and a MemoryUsageSetting argument becomes the stream cache function that creates the same scratch file.

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

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