From 43b06c1abd4a5519e7bb2621b555f209abe00b52 Mon Sep 17 00:00:00 2001 From: Kathy Date: Tue, 13 Nov 2012 12:28:33 +0000 Subject: [PATCH] Use leading to size column heights correctly. --- PROMS/Volian.Print.Library/Grid2Pdf.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/PROMS/Volian.Print.Library/Grid2Pdf.cs b/PROMS/Volian.Print.Library/Grid2Pdf.cs index ddcd2e5e..ac9964b1 100644 --- a/PROMS/Volian.Print.Library/Grid2Pdf.cs +++ b/PROMS/Volian.Print.Library/Grid2Pdf.cs @@ -197,7 +197,14 @@ namespace Volian.Print.Library } iTextSharp.text.Paragraph myPara = RtfToParagraph(str); myColumnText1.SetSimpleColumn(0, 0, w - 2, MyContentByte.PdfDocument.PageSize.Top); // Padding = 4 - myPara.MultipliedLeading = 1.00F; // RHM 20120925 - Line spacing should be 6 lines per inch. + + // RHM 20120925 - Line spacing should be 6 lines per inch. In order to get a valid value + // for TotalLeading you have to set MultipliedLeading first: + myPara.MultipliedLeading = 1.0f; + // once there is valid value for TotalLeading (from previous line), you can use it to + // calculate a MultipliedLeading to give 6 LPI (12 points) + myPara.MultipliedLeading = 12.0f / myPara.TotalLeading; + myPara.SpacingAfter = 8; // RHM 20120925 - Add a line to properly space text from lines. myColumnText1.AddElement(myPara); //myColumnText1.Canvas.SetColorFill(PrintOverride.OverrideTextColor(System.Drawing.Color.Black));