Tasks 184281, 184799, 184800, 184801 and 184802
Align .editorconfig files Move Controller logic to DMO classes GlobalVars.AppSettings = Models.AppSettings.GetFromConfigurationManager(); Question EditorConfig Project level editorconfig Format White Spaces AppSetting when EnvironmentVariable not set Corrective Actions Tests Schedule Actions Tests DMO Tests Controller Tests Get ready to use VSCode IDE
This commit is contained in:
@ -1,17 +1,16 @@
|
||||
|
||||
namespace Fab2ApprovalSystem.PdfGenerator
|
||||
{
|
||||
using System;
|
||||
|
||||
#if !NET8
|
||||
namespace Fab2ApprovalSystem.PdfGenerator {
|
||||
using iTextSharp.text;
|
||||
using iTextSharp.text.pdf;
|
||||
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// This class represents the standard header and footer for a PDF print.
|
||||
/// application.
|
||||
/// </summary>
|
||||
public class PrintHeaderFooter : PdfPageEventHelper
|
||||
{
|
||||
public class PrintHeaderFooter : PdfPageEventHelper {
|
||||
private PdfContentByte pdfContent;
|
||||
private PdfTemplate pageNumberTemplate;
|
||||
private BaseFont baseFont;
|
||||
@ -19,22 +18,19 @@ namespace Fab2ApprovalSystem.PdfGenerator
|
||||
|
||||
public string Title { get; set; }
|
||||
|
||||
public override void OnOpenDocument(PdfWriter writer, Document document)
|
||||
{
|
||||
public override void OnOpenDocument(PdfWriter writer, Document document) {
|
||||
printTime = DateTime.Now;
|
||||
baseFont = BaseFont.CreateFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
|
||||
pdfContent = writer.DirectContent;
|
||||
pageNumberTemplate = pdfContent.CreateTemplate(50, 50);
|
||||
}
|
||||
|
||||
public override void OnStartPage(PdfWriter writer, Document document)
|
||||
{
|
||||
public override void OnStartPage(PdfWriter writer, Document document) {
|
||||
base.OnStartPage(writer, document);
|
||||
|
||||
Rectangle pageSize = document.PageSize;
|
||||
|
||||
if (Title != string.Empty)
|
||||
{
|
||||
if (Title != string.Empty) {
|
||||
pdfContent.BeginText();
|
||||
pdfContent.SetFontAndSize(baseFont, 11);
|
||||
pdfContent.SetRGBColorFill(0, 0, 0);
|
||||
@ -44,8 +40,7 @@ namespace Fab2ApprovalSystem.PdfGenerator
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnEndPage(PdfWriter writer, Document document)
|
||||
{
|
||||
public override void OnEndPage(PdfWriter writer, Document document) {
|
||||
base.OnEndPage(writer, document);
|
||||
|
||||
int pageN = writer.PageNumber;
|
||||
@ -70,8 +65,7 @@ namespace Fab2ApprovalSystem.PdfGenerator
|
||||
pdfContent.EndText();
|
||||
}
|
||||
|
||||
public override void OnCloseDocument(PdfWriter writer, Document document)
|
||||
{
|
||||
public override void OnCloseDocument(PdfWriter writer, Document document) {
|
||||
base.OnCloseDocument(writer, document);
|
||||
|
||||
pageNumberTemplate.BeginText();
|
||||
@ -81,4 +75,5 @@ namespace Fab2ApprovalSystem.PdfGenerator
|
||||
pageNumberTemplate.EndText();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
Reference in New Issue
Block a user