Skip to content

[Feature] SaveAsByTemplateI: Make SaveAsByTemplateImplAsync with Stream parameter public #834

@Ashymonth

Description

@Ashymonth

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:

  1. Provide more flexibility in how template data is provided
  2. Avoid unnecessary conversions
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions