diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 9d5a6d0d..b0934a6a 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -989,7 +989,6 @@ namespace Volian.Print.Library // there may be other places that double space, but this supports it for RNOs (the DoubleRNOspace flag) if (rnoLevel > maxRNO && itemInfo.FormatStepData.DoubleSpace) yoff = YOffset = yoff + SixLinesPerInch; } - if (itemInfo.ItemID == 191) Console.WriteLine("here"); AddMacros(itemInfo, mytab); if (mytab != null) { diff --git a/PROMS/Volian.Print.Library/vlnPrintObject.cs b/PROMS/Volian.Print.Library/vlnPrintObject.cs index a5a724b7..82a76bfc 100644 --- a/PROMS/Volian.Print.Library/vlnPrintObject.cs +++ b/PROMS/Volian.Print.Library/vlnPrintObject.cs @@ -250,6 +250,25 @@ namespace Volian.Print.Library Rtf2iTextSharp rtf2IText = new Rtf2iTextSharp(rtfDoc); iTextSharp.text.Paragraph para = rtf2IText.Convert(); para.SetLeading(_SixLinesPerInch, 0); + if (rtf.Contains("\x05")) + { + // if there is a hanging indent, the iTextSharp paragraph properties must be set + // to print the indent. Replace the indent 'token' with a non-used symbol, this will + // create a chunk with that symbol. Then loop through all of the chunks until we find + // this symbol, adding up the widths to that point. This width is the value that + // needs to be used to set the indent. + IRtfDocument rtfDoc2 = RtfInterpreterTool.BuildDoc(rtf.Replace("\x05", @"\f1 \u9999? \f0 ")); + Rtf2iTextSharp rtf2IText2 = new Rtf2iTextSharp(rtfDoc2); + iTextSharp.text.Paragraph para2 = rtf2IText2.Convert(); + float chkW = 0; + foreach (Chunk chk in para2.Chunks) + { + if (chk.Content[0] == 9999) break; + chkW += chk.GetWidthPoint(); + } + para.IndentationLeft = chkW; + para.FirstLineIndent = -chkW; + } return para; } public abstract float ToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin);