This commit is contained in:
2012-01-10 14:44:24 +00:00
parent afde4b2516
commit 38ef93b9fd
2 changed files with 110 additions and 4 deletions

View File

@@ -54,7 +54,10 @@ namespace Volian.Print.Library
{
cnt++;
string fstr = pct.Text.Replace("{OF}", _Total.ToString());
if (pct.Text.Contains("{TOCPAGE}"))
{
fstr = pct.Text.Replace("{TOCPAGE}", _Total.ToString());
}
if (fstr.Contains("{FINALPAGE}"))
{
fstr = fstr.Replace("{FINALPAGE}", (cnt == MyTemplates.Count) ? FinalPageMessage : "");
@@ -95,6 +98,7 @@ namespace Volian.Print.Library
Increment();
PageCountTemplate retTemplate = new PageCountTemplate(pdfWriter, text.Replace("{PAGE}",Total.ToString()), myFont, alignment, color);
MyTemplates.Add(retTemplate);
return retTemplate.MyTemplate;
}
}
@@ -112,7 +116,11 @@ namespace Volian.Print.Library
}
public PdfTemplate AddToTemplateList(string key, PdfWriter pdfWriter, string text, System.Drawing.Font myFont, int alignment, System.Drawing.Color color)
{
if (!this.ContainsKey(key)) this.Add(key, new PageCount());
if (!this.ContainsKey(key))
{
this.Add(key, new PageCount());
if (key.StartsWith("TOC")) this[key].CanIncrement = false;
}
return (this[key].AddToTemplateList(pdfWriter, text, myFont, alignment,color));
}
public PdfTemplate AddToTemplateList(string key, PdfWriter pdfWriter, string text, string finalPageMessage, System.Drawing.Font myFont, int alignment, System.Drawing.Color color)