From ea85aeba2328cc091b56a6edbd2148d75fb67b24 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 30 Sep 2011 12:52:13 +0000 Subject: [PATCH] RO table was failing in DoCOlorLink. This does not fix the problem. More fixes to support 7LPI when printing grids. --- PROMS/Volian.Controls.Library/DisplayText.cs | 29 ++++++++++++++++---- PROMS/Volian.Print.Library/Grid2Pdf.cs | 14 ++++------ 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplayText.cs b/PROMS/Volian.Controls.Library/DisplayText.cs index 997e68e2..9ee3896e 100644 --- a/PROMS/Volian.Controls.Library/DisplayText.cs +++ b/PROMS/Volian.Controls.Library/DisplayText.cs @@ -10,6 +10,7 @@ namespace Volian.Controls.Library { public class DisplayText { + private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #region Properties private E_FieldToEdit _FieldToEdit; public E_FieldToEdit FieldToEdit @@ -222,14 +223,32 @@ namespace Volian.Controls.Library } private static string DoColorLinks(string text) { + string origtext = text; text = Regex.Replace(text, @"( -1) + { + text = text.Insert(indxend, @"\cf0"); + indxcf = text.IndexOf(@"\v0\cf1", indxend); + } + else + { + indxcf = -1; + _MyLog.WarnFormat("DisplayText.DoColorLinks Failed\r\norgitext:'{0}'\r\ntext'{1}'", origtext, text); + } + } + } + catch (Exception ex) + { + _MyLog.WarnFormat("DisplayText.DoColorLinks Failed\r\norgitext:'{0}'\r\ntext'{1}'", origtext, text); } return text; } diff --git a/PROMS/Volian.Print.Library/Grid2Pdf.cs b/PROMS/Volian.Print.Library/Grid2Pdf.cs index 59693b73..054ed547 100644 --- a/PROMS/Volian.Print.Library/Grid2Pdf.cs +++ b/PROMS/Volian.Print.Library/Grid2Pdf.cs @@ -558,17 +558,13 @@ namespace Volian.Print.Library public void ToPdf(iTextSharp.text.pdf.ColumnText myColumnText, float left, float top) { myColumnText.Canvas.SaveState(); + VlnSvgPageHelper _MyPageHelper = myColumnText.Canvas.PdfWriter.PageEvent as VlnSvgPageHelper; + float mult = _MyPageHelper.YMultiplier; float x = MyTable.ColLeft[c1]; float w = MyTable.ColLeft[c2 + 1] - x; - float y = MyTable.RowTop[r1]; - float h = MyTable.RowTop[r2 + 1] - y; - VlnSvgPageHelper _MyPageHelper = myColumnText.Canvas.PdfWriter.PageEvent as VlnSvgPageHelper; - if (_MyPageHelper.YMultiplier != 1F) - { - Console.WriteLine("'---YMultiplier',{0}", _MyPageHelper.YMultiplier); - Console.WriteLine("'---MultipliedLeading',{0}", MyPara.MultipliedLeading); - } - BordersToPdf(myColumnText, left, top, x, w, y, h * _MyPageHelper.YMultiplier); + float y = mult * MyTable.RowTop[r1]; + float h = mult * MyTable.RowTop[r2 + 1] - y; + BordersToPdf(myColumnText, left, top, x, w, y, h ); float hAdjust = VeritcalTextAlignment(h); iTextSharp.text.pdf.ColumnText myColumnText1 = new iTextSharp.text.pdf.ColumnText(myColumnText.Canvas); myColumnText1.SetSimpleColumn(1 + left + x, top - y - h, left + x + w, 1 + top - y - hAdjust); // 2 == Default Padding