From 3237a2345b356532128ec26c6004292b1c4dd7fb Mon Sep 17 00:00:00 2001 From: Rich Date: Mon, 10 Nov 2014 18:23:44 +0000 Subject: [PATCH] Fixed Logic to limit size of figures to use the whole page and keep the the same aspect ratio. --- PROMS/Volian.Print.Library/vlnParagraph.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index fe8f146a..efc89cbc 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -2095,7 +2095,7 @@ namespace Volian.Print.Library { get { - return (float)(MyItemInfo.MyDocStyle.Layout.PageLength - MyItemInfo.MyDocStyle.Layout.TopMargin - MyItemInfo.MyDocStyle.Layout.FooterLength); + return (float)(MyItemInfo.MyDocStyle.Layout.PageLength /*- MyItemInfo.MyDocStyle.Layout.TopMargin*/ - MyItemInfo.MyDocStyle.Layout.FooterLength); } } public vlnParagraph(vlnParagraph parent, PdfContentByte cb, ItemInfo itemInfo, float xoff, float yoff, int rnoLevel, int maxRNO, FormatInfo formatInfo, string prefix, string suffix, float yoffRightParent, bool loadChildren, PromsPrinter pp) @@ -2608,7 +2608,13 @@ namespace Volian.Print.Library // Check that the Height of figure isn't too big to fit on the page, if it is // set the Height to the printable part of page - Height of the HLS and an extra line // for between HLS & figure. - Height = Math.Min(lines * SixLinesPerInch, RoughSizeOfPage - MyParent.Height - SixLinesPerInch); + float h1 = lines * SixLinesPerInch; + float h2 = RoughSizeOfPage - MyParent.Height - SixLinesPerInch; + Height = Math.Min(h1,h2); + if (h1 > h2) + { + Width *= (h2/h1); + } //yForCheckoff = yoff + Height - SixLinesPerInch; if (dropCheckoff) yForCheckoff += Height - SixLinesPerInch; // place checkoff on last row of text