### Create .NET console project and add OxidizePdf.NET package Source: https://oxidizepdf-net.docs7.io/quickstart Sets up a .NET 8 or newer console project and adds the OxidizePdf.NET package version 0.20.2. Run these commands in a terminal. ```bash dotnet new console -n PdfExample cd PdfExample dotnet add package OxidizePdf.NET --version 0.20.2 ``` -------------------------------- ### Extract text and RAG chunks from PDF with PdfExtractor Source: https://oxidizepdf-net.docs7.io/quickstart Replaces Program.cs to read a PDF file, extract text, and generate RAG chunks. Uses one-based page numbers and FullText includes heading context when available. PdfExtractor is not disposable; file and PDF errors propagate to the caller. Reads entire file into memory; requires a text layer (scanned pages need OCR). ```csharp using OxidizePdf.NET; using OxidizePdf.NET.Pipeline; byte[] pdfBytes = File.ReadAllBytes("document.pdf"); var extractor = new PdfExtractor(); string text = await extractor.ExtractTextAsync(pdfBytes); Console.WriteLine(text); var chunks = await extractor.RagChunksAsync(pdfBytes, ExtractionProfile.Rag); foreach (var chunk in chunks) { Console.WriteLine($"Pages: {string.Join(", ", chunk.PageNumbers)}"); Console.WriteLine(chunk.FullText); } ``` -------------------------------- ### Ask Context7 to resolve OxidizePdf.NET documentation Source: https://oxidizepdf-net.docs7.io/context7 Use this prompt with a coding assistant to fetch version-specific documentation for the OxidizePdf.NET library. Replace the version number with the one you are using. The assistant must resolve the library by its repository URL and verify the returned project and version before querying. ```text Use Context7 to find documentation for https://github.com/bzsanti/oxidize-pdf-dotnet. I am using OxidizePdf.NET 0.20.2. Show an example using the API documented for that version. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.