Na most menti a képet is a PDF-be
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user