Criado nova biblioteca de classes para os demais projetos referênciarem a classe "Fatura.cs" Atualização de bibliotecas.
30 lines
1.2 KiB
C#
30 lines
1.2 KiB
C#
// <copyright file="CustomPdfSplitter.cs" company="Smart Energia">
|
|
// Copyright (c) Smart Energia. All rights reserved.
|
|
// </copyright>
|
|
|
|
namespace Faturas
|
|
{
|
|
using iText.Kernel.Pdf;
|
|
using iText.Kernel.Utils;
|
|
|
|
/// <summary>
|
|
/// Custom PDF splitter that allows specifying a function to create the next PDF writer.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Initializes a new instance of the <see cref="CustomPdfSplitter"/> class.
|
|
/// </remarks>
|
|
/// <param name="pdfDocument">The PDF document to split.</param>
|
|
/// <param name="nextWriter">A function that returns the next PdfWriter given a PageRange.</param>
|
|
public class CustomPdfSplitter(PdfDocument pdfDocument, Func<PageRange, PdfWriter> nextWriter) : PdfSplitter(pdfDocument)
|
|
{
|
|
/// <summary>
|
|
/// Gets the next PDF writer for the specified page range.
|
|
/// </summary>
|
|
/// <param name="documentPageRange">The page range for which to get the next PDF writer.</param>
|
|
/// <returns>The next PDF writer.</returns>
|
|
protected override PdfWriter GetNextPdfWriter(PageRange documentPageRange)
|
|
{
|
|
return nextWriter.Invoke(documentPageRange);
|
|
}
|
|
}
|
|
} |