Made some regx usages static to help with memory usage

Logic to support clipboard paste of screen shot into a table cell
This commit is contained in:
2015-11-24 18:28:59 +00:00
parent ba3bceadae
commit df37f61cb5
5 changed files with 147 additions and 58 deletions

View File

@@ -512,12 +512,13 @@ namespace Volian.Print.Library
}
private void TrimNewlines(Paragraph myPara)
{
while (myPara.Chunks.Count > 0 && ParaEndsWithNewLine(myPara))
myPara.RemoveAt(myPara.Chunks.Count - 1);
while (myPara.Count > 0 && ParaEndsWithNewLine(myPara))
myPara.RemoveAt(myPara.Count - 1);
}
private bool ParaEndsWithNewLine(Paragraph myPara)
{
Chunk chk = myPara.Chunks[myPara.Chunks.Count - 1] as Chunk;
Chunk chk = myPara[myPara.Count - 1] as Chunk;
if (chk == null) return false;
if (chk.Content == "\n") return true;
return false;
}
@@ -1056,6 +1057,17 @@ namespace Volian.Print.Library
MyPara.MultipliedLeading *= _MyPageHelper.YMultiplier;
vlnCells.FixHyphens(MyPara, MyTable);
myColumnText1.AddElement(MyPara);
foreach(object obj in MyPara)
{
if(obj is iTextSharp.text.Image)
{
iTextSharp.text.Image img = obj as iTextSharp.text.Image;
img.SetAbsolutePosition(left,top-h);
img.ScaleAbsoluteWidth(w);
img.ScaleAbsoluteHeight(h);
myColumnText.Canvas.AddImage(img);
}
}
float posBefore = myColumnText1.YLine; // RHM20150429 - Table Scrunch
myColumnText1.Go();
float posAfter = myColumnText1.YLine; // RHM20150429 - Table Scrunch