// // Copyright (c) Smart Energia. All rights reserved. // namespace Faturas { using iText.Kernel.Pdf; using iText.Kernel.Utils; /// /// Custom PDF splitter that allows specifying a function to create the next PDF writer. /// /// /// Initializes a new instance of the class. /// /// The PDF document to split. /// A function that returns the next PdfWriter given a PageRange. public class CustomPdfSplitter(PdfDocument pdfDocument, Func nextWriter) : PdfSplitter(pdfDocument) { /// /// Gets the next PDF writer for the specified page range. /// /// The page range for which to get the next PDF writer. /// The next PDF writer. protected override PdfWriter GetNextPdfWriter(PageRange documentPageRange) { return nextWriter.Invoke(documentPageRange); } } }