Temporary fix to allow V.C. Summer tables (with indent chars) print

This commit is contained in:
John Jenko 2014-10-10 18:23:43 +00:00
parent 42e05cc3cd
commit 7a29281284

View File

@ -252,7 +252,21 @@ namespace Volian.Print.Library
public static float CalculateHangingIndent(string rtf)
{
float chkW = 0;
IRtfDocument rtfDoc2 = RtfInterpreterTool.BuildDoc(rtf.Replace(@"\'05", @"\f1 \u9999? \f0 "));
// **** This is intened to be a temporary fix for V.C.Summer ****
// Two procedures would not print: A-2 SAG in Summer's SAMG set, and SAG-3 in Summer's PWOG DAMG set.
// These procedures have tables with hanging indents and use the Letter Gothic Tall font.
// It appears that the font information for the hanging indent character is not included in the RTF
// for those table cells.
// This piece of code checks for the existance of a font definition of \f1 which is need for the \u9999? indent character
// If the a font definition of \f1 is not found then the indent character is removed. This will allow the procedure to print
// but the text in that table cell will not be indented. - jsj 10/10/2014
//IRtfDocument rtfDoc2 = RtfInterpreterTool.BuildDoc(rtf.Replace(@"\'05", @"\f1 \u9999? \f0 "));
IRtfDocument rtfDoc2 = null;
if (rtf.Contains(@"\f1\fnil\fcharset0 "))
rtfDoc2 = RtfInterpreterTool.BuildDoc(rtf.Replace(@"\'05", @"\f1 \u9999? \f0 "));
else
rtfDoc2 = RtfInterpreterTool.BuildDoc(rtf.Replace(@"\'05", ""));
Rtf2iTextSharp rtf2IText2 = new Rtf2iTextSharp(rtfDoc2);
iTextSharp.text.Paragraph para2 = rtf2IText2.Convert();
foreach (Chunk chk in para2.Chunks)