Выход из альфы
This commit is contained in:
@@ -8,7 +8,7 @@ namespace Otchinslator.Services;
|
||||
|
||||
public interface IStatementGenerator
|
||||
{
|
||||
public Task<MemoryStream> GenerateStatementAsync(UserData userData);
|
||||
public Task<MemoryStream> GenerateStatementAsync(UserData userData, string TemplateName = "ictis.docx");
|
||||
public Task<Stream> ConvertToPDFAsync(MemoryStream stream);
|
||||
}
|
||||
|
||||
@@ -21,9 +21,10 @@ public class StatementGenerator(GotenbergSharpClient gotenbergSharpClient) : ISt
|
||||
private const string FreeEducationText = "за счет ассигнований федерального бюджета";
|
||||
private const string PaidEducationText = "на договорной (платной) основе";
|
||||
|
||||
public async Task<MemoryStream> GenerateStatementAsync(UserData userData)
|
||||
// TODO: Выбор темплейтов не реализован
|
||||
public async Task<MemoryStream> GenerateStatementAsync(UserData userData, string TemplateName = "ictis.docx")
|
||||
{
|
||||
byte[] textByteArray = File.ReadAllBytes("Templates/ictis.docx");
|
||||
byte[] textByteArray = File.ReadAllBytes("Templates/" + TemplateName);
|
||||
MemoryStream stream = new MemoryStream();
|
||||
stream.Write(textByteArray, 0, textByteArray.Length);
|
||||
using (WordprocessingDocument doc = WordprocessingDocument.Open(stream, true))
|
||||
|
||||
Reference in New Issue
Block a user