TekH 94ce416aa1 refactor(Pdf); rename OutputStream as ExportStream
- rename ToBytes extension method as ExportAsBytes
2025-09-25 12:52:50 +02:00

17 lines
571 B
C#

#if NETFRAMEWORK
using System.IO;
#endif
namespace EnvelopeGenerator.PdfEditor
{
public static class Extensions
{
/// <summary>
/// Writes the stream contents to a byte array, regardless of the System.IO.MemoryStream.Position property.
/// </summary>
/// <typeparam name="TPdf"></typeparam>
/// <param name="pdf"></param>
/// <returns>A new byte array</returns>
public static byte[] ExportAsBytes<TPdf>(this TPdf pdf) where TPdf : Pdf<MemoryStream, MemoryStream> => pdf.ExportStream().ToArray();
}
}