Added Profile debug

Changed NextItem property to use GetNextItem method when printing
Changed RegisterFont to improve print performance
This commit is contained in:
Rich
2015-01-19 20:58:05 +00:00
parent 389c6575d0
commit 8df668c5e2
4 changed files with 67 additions and 12 deletions

View File

@@ -8,6 +8,7 @@ using Volian.Svg.Library;
using System.Text.RegularExpressions;
using System.Xml;
using VEPROMS.CSLA.Library;
using Volian.Base.Library;
namespace Volian.Print.Library
{
@@ -200,6 +201,7 @@ namespace Volian.Print.Library
//}
public override void OnEndPage(PdfWriter writer, iTextSharp.text.Document document)
{
int profileDepth = ProfileTimer.Push(">>>> OnEndPage");
InitialsPrinted = false;
MyPromsPrinter.OnStatusChanged(string.Format("Page {0}", CurrentPageNumber+1));
bool onBlankPage = OnBlankPage;
@@ -286,6 +288,7 @@ namespace Volian.Print.Library
PageListLastCheckOffHeader = null;
YMultiplier = 1;
PrintedAPage = true;
ProfileTimer.Pop(profileDepth);
}
private void DrawVertical(PdfContentByte cb, float x, float top, float bottom)

View File

@@ -10,6 +10,7 @@ using Itenso.Rtf.Interpreter;
using Itenso.Rtf.Support;
using Volian.Controls.Library;
using VEPROMS.CSLA.Library;
using Volian.Base.Library;
namespace Volian.Print.Library
{
@@ -90,7 +91,10 @@ namespace Volian.Print.Library
{
if (_IParagraph == null)
{
_IParagraph = RtfToParagraph(Rtf, HasIndent);
int profileDepth = ProfileTimer.Push(">>>> VlnPrintObject.IParagraph");
string myRtf = Rtf;
_IParagraph = RtfToParagraph(myRtf, HasIndent);
ProfileTimer.Pop(profileDepth);
}
return _IParagraph;
}
@@ -107,8 +111,10 @@ namespace Volian.Print.Library
{
get
{
int profileDepth = ProfileTimer.Push(">>>> vlnPrintObject.Height");
if (_Height == 0)
_Height = GetParagraphHeight(MyContentByte, IParagraph, Width);
ProfileTimer.Pop(profileDepth);
return _Height;
}
set { _Height = value; }

View File

@@ -162,7 +162,7 @@ namespace Volian.Print.Library
// Because of the different font sizes, when the Caution/Note did have have a bullet, the positioning
// was off by the lenght of IdentB (the bullet string), thus the "alignAsIfBulleted" bool
if ((myparent.MyItemInfo.FormatStepData != null) && myparent.MyItemInfo.FormatStepData.TabData.Bullet.Separate)
if (myparent.MyItemInfo.MyPrevious != null || myparent.MyItemInfo.GetNextItem() != null)
if (myparent.MyItemInfo.MyPrevious != null || myparent.MyItemInfo.NextItem != null)
SeparateBullet = true;
else
alignAsIfBulleted = true;
@@ -260,7 +260,7 @@ namespace Volian.Print.Library
Rtf = Rtf.Replace("Caution ", @"\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?");
else
{
if (myparent.MyItemInfo.FormatStepData != null && !myparent.MyItemInfo.FormatStepData.AlwaysTab && myparent.MyItemInfo.GetNextItem() == null)
if (myparent.MyItemInfo.FormatStepData != null && !myparent.MyItemInfo.FormatStepData.AlwaysTab && myparent.MyItemInfo.NextItem == null)
Rtf = Rtf.Replace(@"\u9679?", "");
Rtf = Rtf.Replace("Caution ", @"\u61507?\u61537?\u61557?\u61556?\u61545?\u61551?\u61550?\u61472?\u61472?");
}