Print Library, Svg Library, Utils Library, XYPlots
This commit is contained in:
@@ -1,40 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using iTextSharp.text;
|
||||
using iTextSharp.text.pdf;
|
||||
using Volian.Svg.Library;
|
||||
|
||||
namespace Volian.Print.Library
|
||||
{
|
||||
public class PageCount
|
||||
{
|
||||
private bool _CanIncrement = true;
|
||||
public bool CanIncrement
|
||||
{
|
||||
get { return _CanIncrement; }
|
||||
set { _CanIncrement = value; }
|
||||
}
|
||||
private int Increment()
|
||||
public bool CanIncrement { get; set; } = true;
|
||||
private int Increment()
|
||||
{
|
||||
if (CanIncrement) Total++;
|
||||
CanIncrement = false;
|
||||
return Total;
|
||||
}
|
||||
private int _Total;
|
||||
public int Total
|
||||
{
|
||||
get { return _Total; }
|
||||
set { _Total = value; }
|
||||
}
|
||||
private string _FinalPageMessage;
|
||||
|
||||
public string FinalPageMessage
|
||||
{
|
||||
get { return _FinalPageMessage; }
|
||||
set { _FinalPageMessage = value; }
|
||||
}
|
||||
private PageCountTemplates _MyTemplates; // (for each page that has this key)
|
||||
public int Total { get; set; }
|
||||
|
||||
public string FinalPageMessage { get; set; }
|
||||
private PageCountTemplates _MyTemplates; // (for each page that has this key)
|
||||
internal PageCountTemplates MyTemplates
|
||||
{
|
||||
get
|
||||
@@ -53,10 +36,10 @@ namespace Volian.Print.Library
|
||||
foreach (PageCountTemplate pct in MyTemplates)
|
||||
{
|
||||
cnt++;
|
||||
string fstr = pct.Text.Replace("{OF}", _Total.ToString());
|
||||
string fstr = pct.Text.Replace("{OF}", Total.ToString());
|
||||
if (pct.Text.Contains("{TOCPAGE}"))
|
||||
{
|
||||
fstr = pct.Text.Replace("{TOCPAGE}", _Total.ToString());
|
||||
fstr = pct.Text.Replace("{TOCPAGE}", Total.ToString());
|
||||
}
|
||||
if (fstr.Contains("{FINALPAGE}"))
|
||||
{
|
||||
@@ -140,45 +123,21 @@ namespace Volian.Print.Library
|
||||
|
||||
public class PageCountTemplate
|
||||
{
|
||||
private string _Text;
|
||||
public string Text // "Page 1 of {OF}"
|
||||
{
|
||||
get { return _Text; }
|
||||
set { _Text = value; }
|
||||
}
|
||||
private System.Drawing.Font _MyFont;
|
||||
public System.Drawing.Font MyFont
|
||||
{
|
||||
get { return _MyFont; }
|
||||
set { _MyFont = value; }
|
||||
}
|
||||
private int _Alignment; // iTextSharp Element.<XYZ>
|
||||
public int Alignment
|
||||
{
|
||||
get { return _Alignment; }
|
||||
set { _Alignment = value; }
|
||||
}
|
||||
private System.Drawing.Color _MyColor;
|
||||
public System.Drawing.Color MyColor
|
||||
{
|
||||
get { return _MyColor; }
|
||||
set { _MyColor = value; }
|
||||
}
|
||||
private PdfTemplate _MyTemplate;
|
||||
public PdfTemplate MyTemplate
|
||||
{
|
||||
get { return _MyTemplate; }
|
||||
set { _MyTemplate = value; }
|
||||
}
|
||||
public PageCountTemplate(PdfWriter pdfWriter, string text, System.Drawing.Font myFont, int alignment, System.Drawing.Color color)
|
||||
public string Text // "Page 1 of {OF}"
|
||||
{ get; set; }
|
||||
public System.Drawing.Font MyFont { get; set; }
|
||||
public int Alignment { get; set; }
|
||||
public System.Drawing.Color MyColor { get; set; }
|
||||
public PdfTemplate MyTemplate { get; set; }
|
||||
public PageCountTemplate(PdfWriter pdfWriter, string text, System.Drawing.Font myFont, int alignment, System.Drawing.Color color)
|
||||
{
|
||||
// Create Template can be called with a small, i.e. 1, width/height because when
|
||||
// it is actually drawn, the bounding box overrides the CreateTemplate values.
|
||||
_MyTemplate = pdfWriter.DirectContent.CreateTemplate(1, 1);
|
||||
_Text = text;
|
||||
_MyFont = myFont;
|
||||
_MyColor = color;
|
||||
_Alignment = alignment;
|
||||
MyTemplate = pdfWriter.DirectContent.CreateTemplate(1, 1);
|
||||
Text = text;
|
||||
MyFont = myFont;
|
||||
MyColor = color;
|
||||
Alignment = alignment;
|
||||
}
|
||||
}
|
||||
public class PageCountTemplates : List<PageCountTemplate>
|
||||
|
||||
Reference in New Issue
Block a user