PDF készítés DevExpressel.

This commit is contained in:
2025-04-02 13:01:49 +02:00
parent 12bf69aadd
commit 90637b3848
9 changed files with 114 additions and 109 deletions
@@ -426,14 +426,22 @@ namespace WorkFlowCheck.BL.Services
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);
try
{
string pdfDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Pdf");
byte[] content = gen.CloseAndGetDocument();
byte[] byteArray = File.ReadAllBytes(Path.Combine(pdfDirectory, "CheckList_Template_V1.docx"));
SablonGenerator gen = new SablonGenerator(byteArray);
return DokumentumGenerator.DocxToPdf(content);
byte[] content = gen.CloseAndGetDocument();
return DokumentumGenerator.DocxToPdf(content);
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return new byte[0];
}
}
}