-
-
Notifications
You must be signed in to change notification settings - Fork 408
Description
Description:
Currently, there are two public methods that accept different input types (string path and byte[]) for template data, both of which internally convert to a Stream and call SaveAsByTemplateImplAsync. However, the Stream-based implementation is marked as internal.
This creates unnecessary limitations when:
The template data is already available as a Stream
The source isn't a file path or byte array (e.g., from network, in-memory generated stream, etc.)
Request:
Please make SaveAsByTemplateImplAsync public so we can directly pass Stream objects. This would:
- Provide more flexibility in how template data is provided
- Avoid unnecessary conversions
- Maintain consistency with common .NET patterns where Stream-based methods are publicly available
Example usage:
using var stream = GetTemplateFromSomewhere();
await document.SaveAsByTemplateAsync(stream, data);
Current workaround:
Users must either:
Write to a temporary file and use the path-based version, or
Convert to byte array and use that version
Both workarounds have performance and resource implications.