From 2dcb0a0bd6855573f15cf79dcb71742bd29c79aa Mon Sep 17 00:00:00 2001 From: Kathy Date: Fri, 26 Oct 2012 10:32:22 +0000 Subject: [PATCH] --- PROMS/Volian.Print.Library/Rtf2iTextSharp.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/PROMS/Volian.Print.Library/Rtf2iTextSharp.cs b/PROMS/Volian.Print.Library/Rtf2iTextSharp.cs index 298a3319..980b98fe 100644 --- a/PROMS/Volian.Print.Library/Rtf2iTextSharp.cs +++ b/PROMS/Volian.Print.Library/Rtf2iTextSharp.cs @@ -88,6 +88,13 @@ namespace Volian.Print.Library } public class Rtf2iTextSharp : RtfVisualVisitorBase { + private static bool _DoingComparison = false; + public static bool DoingComparison + { + get { return Rtf2iTextSharp._DoingComparison; } + set { Rtf2iTextSharp._DoingComparison = value; } + } + private IRtfDocument _RtfDoc; private Paragraph _MyParagraph = new Paragraph(); private iTextSharp.text.Font _MyFont; @@ -177,6 +184,11 @@ namespace Volian.Print.Library (visualText.Format.IsBold ? iTextSharp.text.Font.BOLD : 0) + (visualText.Format.IsItalic ? iTextSharp.text.Font.ITALIC : 0)); font.Color = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(visualText.Format.ForegroundColor.AsDrawingColor)); + // The following line of code was added to allow for comparisons between the 16bit and 32bit pdf files. Without + // the size change, the overlays did not match up. It seems that the 16bit font size may be inaccurate + // and the 16bit conversion to be pdf may be off. + if (font.Familyname.StartsWith("Arial") && font.Size == 11 && DoingComparison) font.Size = 11.15f; + Chunk chk = new Chunk(visualText.Text, font); if(visualText.Format.BackgroundColor.AsDrawingColor.ToArgb() != System.Drawing.Color.White.ToArgb()) chk.SetBackground(new iTextSharp.text.Color(visualText.Format.BackgroundColor.AsDrawingColor));