Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
bdf1a8060f | |||
54799f54ec | |||
7eba0fa25a | |||
65a433e9ab |
@ -700,6 +700,7 @@ public class ECNController : Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if !NET8
|
#if !NET8
|
||||||
|
|
||||||
public ActionResult GetApproversList([DataSourceRequest] DataSourceRequest request, int issueID, byte step, bool isTECN, bool isEmergrncyTECN) {
|
public ActionResult GetApproversList([DataSourceRequest] DataSourceRequest request, int issueID, byte step, bool isTECN, bool isEmergrncyTECN) {
|
||||||
int isITARCompliant = 0;
|
int isITARCompliant = 0;
|
||||||
ECN ecn = new ECN();
|
ECN ecn = new ECN();
|
||||||
@ -945,13 +946,11 @@ public class ECNController : Controller {
|
|||||||
try {
|
try {
|
||||||
#if !NET8
|
#if !NET8
|
||||||
ViewEngineResult viewResult = ViewEngines.Engines.FindView(ControllerContext, viewName, string.Empty);
|
ViewEngineResult viewResult = ViewEngines.Engines.FindView(ControllerContext, viewName, string.Empty);
|
||||||
if (viewResult is null) {
|
if (viewResult is null)
|
||||||
return $"A view with the name '{viewName}' could not be found";
|
return $"A view with the name '{viewName}' could not be found";
|
||||||
}
|
|
||||||
ViewContext viewContext = new(ControllerContext, viewResult.View, ViewData, TempData, writer);
|
ViewContext viewContext = new(ControllerContext, viewResult.View, ViewData, TempData, writer);
|
||||||
viewResult.View.Render(viewContext, writer);
|
viewResult.View.Render(viewContext, writer);
|
||||||
string htmlText = writer.GetStringBuilder().ToString();
|
result = writer.GetStringBuilder().ToString();
|
||||||
result = htmlText.Replace("navbar-header", "navbar-header-hidden");
|
|
||||||
#endif
|
#endif
|
||||||
#if NET8
|
#if NET8
|
||||||
ViewEngineResult viewResult;
|
ViewEngineResult viewResult;
|
||||||
|
@ -243,13 +243,11 @@ public class LotTravelerController : Controller {
|
|||||||
try {
|
try {
|
||||||
#if !NET8
|
#if !NET8
|
||||||
ViewEngineResult viewResult = ViewEngines.Engines.FindView(ControllerContext, viewName, string.Empty);
|
ViewEngineResult viewResult = ViewEngines.Engines.FindView(ControllerContext, viewName, string.Empty);
|
||||||
if (viewResult is null) {
|
if (viewResult is null)
|
||||||
return $"A view with the name '{viewName}' could not be found";
|
return $"A view with the name '{viewName}' could not be found";
|
||||||
}
|
|
||||||
ViewContext viewContext = new(ControllerContext, viewResult.View, ViewData, TempData, writer);
|
ViewContext viewContext = new(ControllerContext, viewResult.View, ViewData, TempData, writer);
|
||||||
viewResult.View.Render(viewContext, writer);
|
viewResult.View.Render(viewContext, writer);
|
||||||
string htmlText = writer.GetStringBuilder().ToString();
|
result = writer.GetStringBuilder().ToString();
|
||||||
result = htmlText.Replace("navbar-header", "navbar-header-hidden");
|
|
||||||
#endif
|
#endif
|
||||||
#if NET8
|
#if NET8
|
||||||
ViewEngineResult viewResult;
|
ViewEngineResult viewResult;
|
||||||
|
@ -326,9 +326,6 @@
|
|||||||
<Compile Include="Models\WinEventLogModel.cs" />
|
<Compile Include="Models\WinEventLogModel.cs" />
|
||||||
<Compile Include="Models\WorkFlowModels.cs" />
|
<Compile Include="Models\WorkFlowModels.cs" />
|
||||||
<Compile Include="PdfGenerator\BinaryContentResult.cs" />
|
<Compile Include="PdfGenerator\BinaryContentResult.cs" />
|
||||||
<Compile Include="PdfGenerator\FakeView.cs" />
|
|
||||||
<Compile Include="PdfGenerator\HtmlViewRenderer.cs" />
|
|
||||||
<Compile Include="PdfGenerator\PdfViewController.cs" />
|
|
||||||
<Compile Include="PdfGenerator\PrintHeaderFooter.cs" />
|
<Compile Include="PdfGenerator\PrintHeaderFooter.cs" />
|
||||||
<Compile Include="PdfGenerator\StandardPdfRenderer.cs" />
|
<Compile Include="PdfGenerator\StandardPdfRenderer.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
@ -1 +0,0 @@
|
|||||||
|
|
@ -15,10 +15,11 @@ public class StandardPdfRenderer {
|
|||||||
|
|
||||||
public static byte[] GetPortableDocumentFormatBytes(string pageTitle, string htmlText) {
|
public static byte[] GetPortableDocumentFormatBytes(string pageTitle, string htmlText) {
|
||||||
byte[] results;
|
byte[] results;
|
||||||
MemoryStream memoryStream = GetPortableDocumentFormat(pageTitle, htmlText);
|
using (MemoryStream memoryStream = GetPortableDocumentFormat(pageTitle, htmlText)) {
|
||||||
results = new byte[memoryStream.Position];
|
results = new byte[memoryStream.Position];
|
||||||
memoryStream.Position = 0;
|
memoryStream.Position = 0;
|
||||||
memoryStream.Read(results, 0, results.Length);
|
memoryStream.Read(results, 0, results.Length);
|
||||||
|
}
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +35,7 @@ public class StandardPdfRenderer {
|
|||||||
MemoryStream result = new();
|
MemoryStream result = new();
|
||||||
#if !NET8
|
#if !NET8
|
||||||
using (Document pdfDocument = new Document(PageSize.A4, HorizontalMargin, HorizontalMargin, VerticalMargin, VerticalMargin)) {
|
using (Document pdfDocument = new Document(PageSize.A4, HorizontalMargin, HorizontalMargin, VerticalMargin, VerticalMargin)) {
|
||||||
PdfWriter pdfWriter = PdfWriter.GetInstance(pdfDocument, result);
|
using (PdfWriter pdfWriter = PdfWriter.GetInstance(pdfDocument, result)) {
|
||||||
pdfWriter.CloseStream = false;
|
pdfWriter.CloseStream = false;
|
||||||
pdfWriter.PageEvent = new PrintHeaderFooter { Title = pageTitle };
|
pdfWriter.PageEvent = new PrintHeaderFooter { Title = pageTitle };
|
||||||
pdfDocument.Open();
|
pdfDocument.Open();
|
||||||
@ -44,6 +45,7 @@ public class StandardPdfRenderer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user