Na most menti a képet is a PDF-be

This commit is contained in:
2025-04-10 16:18:33 +02:00
parent 06f5a5dd62
commit 13b9d943b9
6 changed files with 179 additions and 7 deletions
@@ -27,8 +27,8 @@ namespace WorkFlowCheck.BL.Services
private readonly IMapper _mapper;
private readonly INumberGeneratorService _numberGeneratorService;
public CheckListService(AppDbContext dbContext,
IMapper mapper,
public CheckListService(AppDbContext dbContext,
IMapper mapper,
INumberGeneratorService numberGeneratorService,
IUserService userService)
{
@@ -288,7 +288,13 @@ namespace WorkFlowCheck.BL.Services
byte[] content = gen.CloseAndGetDocument();
return DokumentumGenerator.DocxToPdfL(content);
string imageDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Images");
var images = checkListHeader.CheckListRowDTO.Where(w => (w.CheckListTemplateRowDTO.AnswerType == "P" || w.CheckListTemplateRowDTO.AnswerType == "PN") &&
string.IsNullOrEmpty(w.Answer) != true)
.Select(s => Path.Combine(imageDirectory, s.Answer))
.ToList();
return DokumentumGenerator.DocxToPdfL(content, images);
}
catch (Exception ex)
{
@@ -315,8 +321,8 @@ namespace WorkFlowCheck.BL.Services
await _dbContext.SaveChangesAsync();
retVal = true;
}
}