PDF készítés DevExpressel.
This commit is contained in:
@@ -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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user