WORD -> PDF

This commit is contained in:
2025-03-27 11:13:42 +01:00
parent cb38e869a1
commit 04cca012f4
16 changed files with 808 additions and 7 deletions
@@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WorkFlowCheck.BL.DocumentGenerator;
using WorkFlowCheck.BL.Services.Interfaces;
using WorkFlowCheck.Common.DTO;
using WorkFlowCheck.DL;
@@ -51,7 +52,7 @@ namespace WorkFlowCheck.BL.Services
.OrderBy(r => r.CheckListTemplateRow.CheckPoint?.ShortName ?? string.Empty)
.ThenBy(r => r.CheckListTemplateRow.RowIndex)
.ToList();
}
if (res != null)
@@ -361,5 +362,17 @@ namespace WorkFlowCheck.BL.Services
return retVal;
}
public byte[] CreatePDF(int checkListHeaderId)
{
var location = System.Reflection.Assembly.GetEntryAssembly().Location;
var directory = System.IO.Path.GetDirectoryName(location);
byte[] byteArray = System.IO.File.ReadAllBytes(Path.Combine(directory, "DocumentGenerator", "CheckList_Template_V1.docx"));
SablonGenerator gen = new SablonGenerator(byteArray);
byte[] content = gen.CloseAndGetDocument();
return DokumentumGenerator.DocxToPdf(content);
}
}
}
@@ -23,5 +23,6 @@ namespace WorkFlowCheck.BL.Services.Interfaces
Task<CheckListTemplateRowDTO> GetCheckListTemplateRowAsync(int id);
Task<CheckListTemplateRowDTO> UpdateCheckListTemplateRowAsync(CheckListTemplateRowDTO checkListTemplateRowDTO);
byte[] CreatePDF(int checkListHeaderId);
}
}
@@ -22,7 +22,7 @@ namespace WorkFlowCheck.BL.Services.Interfaces
Task<List<UserRoleDTO>> GetAllUserRoleAsync();
Task<UserRoleDTO> UpdateUserRoleAsync(UserRoleDTO userRoleDTO);
Task<List<RoleCheckListTemplateHeaderDTO>> GetAllRoleCheckListTemplateHeadersAsync();
string GenerateJwtToken(UserDTO userDTO);
}
@@ -340,5 +340,6 @@ namespace WorkFlowCheck.BL.Services
return retVal;
}
public Task<List<RoleCheckListTemplateHeaderDTO>> GetAllRoleCheckListTemplateHeadersAsync() => throw new NotImplementedException();
}
}