feat(pdf): add optional output stream parameter to FromMemory overload

- Updated Pdf.FromMemory(MemoryStream) to accept an optional outputStream parameter
- Ensures flexibility when reusing existing MemoryStreams for output
- Added conditional nullability support for .NET builds
This commit is contained in:
2025-10-23 14:30:30 +02:00
parent c456d67d03
commit 75d975223e

View File

@@ -18,9 +18,13 @@ namespace EnvelopeGenerator.PdfEditor
return new Pdf<MemoryStream, MemoryStream>(new MemoryStream(documentBytes), new MemoryStream());
}
public static Pdf<MemoryStream, MemoryStream> FromMemory(MemoryStream stream)
public static Pdf<MemoryStream, MemoryStream> FromMemory(MemoryStream stream, MemoryStream
#if NET
?
#endif
outputStream = null)
{
return new Pdf<MemoryStream, MemoryStream>(stream, new MemoryStream(), disposeInputStream: false);
return new Pdf<MemoryStream, MemoryStream>(stream, outputStream ?? new MemoryStream(), disposeInputStream: false);
}
}