C2018-004 logic to print meta file information

C2018-009 logic to print PROMS version on PDF pages
This commit is contained in:
2018-04-12 20:33:52 +00:00
parent 72a91a6431
commit ff796c7e1c
8 changed files with 215 additions and 35 deletions

View File

@@ -983,6 +983,18 @@ namespace Volian.Svg.Library
get { return _Watermark; }
set { _Watermark = value; }
}
private PdfLayer _PROMSVersionLayer; //C2018-009 print PROMS version
public PdfLayer PROMSVersionLayer
{
get { return _PROMSVersionLayer; }
set { _PROMSVersionLayer = value; }
}
private string _PROMSVersion = string.Empty;
public string PROMSVersion
{
get { return _PROMSVersion; }
set { _PROMSVersion = value; }
}
private bool _DoZoomOMatic = false;
public bool DoZoomOMatic
{
@@ -1061,6 +1073,7 @@ namespace Volian.Svg.Library
DrawBackground(writer.DirectContentUnder);
DrawPageList(writer.DirectContent);
DrawWatermark(writer.DirectContent);
DrawPROMSVersion(writer.DirectContent); //C2018-009 print PROMS version
if (DoZoomOMatic) DrawZoomOMatic(writer.DirectContent);
}
CurrentPageNumber++;
@@ -1074,6 +1087,7 @@ namespace Volian.Svg.Library
DrawBackground(writer.DirectContentUnder);
DrawPageList(writer.DirectContent);
DrawWatermark(writer.DirectContent);
DrawPROMSVersion(writer.DirectContent); //C2018-009 print PROMS version
if (DoZoomOMatic) DrawZoomOMatic(writer.DirectContent);
CurrentPageNumber++;
}
@@ -1169,6 +1183,23 @@ namespace Volian.Svg.Library
if (_WatermarkLayer != null) cb.EndLayer();
cb.RestoreState();
}
//C2018-009 print PROMS version
private void DrawPROMSVersion(PdfContentByte cb)
{
cb.SaveState();
string text = PROMSVersion;
float textBase =cb.PdfDocument.Top + 19;
float textLeft = cb.PdfDocument.Right - 15;
if (_PROMSVersionLayer != null) cb.BeginLayer(_PROMSVersionLayer);
cb.BeginText();
cb.SetFontAndSize(BaseFont.CreateFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.EMBEDDED), 6f);
cb.SetTextMatrix(textLeft, textBase);
cb.SetColorFill(new iTextSharp.text.Color(System.Drawing.Color.Indigo));
cb.ShowText(text);
cb.EndText();
if (_PROMSVersionLayer != null) cb.EndLayer();
cb.RestoreState();
}
private void DrawPageList(PdfContentByte cb)
{
if (_MySvg != null)