B2019-059 – replaced a hard coded 12 with SixLinesPerInch variable

B2019-059 – only one blank line after a figure
This commit is contained in:
John Jenko 2019-04-17 17:59:20 +00:00
parent e803ec1cb2
commit 644e289561
2 changed files with 6 additions and 6 deletions

View File

@ -244,7 +244,7 @@ namespace Volian.Print.Library
if (ex == value) return true;
return false;
}
public static float FigureAt(PdfContentByte cb, iTextSharp.text.Image image, float x, float y, float width, float height, string debugText, float yBottommargin, bool hasBorder, int itmID)
public static float FigureAt(PdfContentByte cb, iTextSharp.text.Image image, float x, float y, float width, float height, string debugText, float yBottommargin, bool hasBorder, int itmID, float sixLinesPerInch)
{
if (cb.PdfDocument.PageNumber != _lastPageNum) // C2018-004 create meta file for baseline compares
{
@ -254,7 +254,7 @@ namespace Volian.Print.Library
VlnSvgPageHelper _MyPageHelper = cb.PdfWriter.PageEvent as VlnSvgPageHelper;
PdfLayer textLayer = _MyPageHelper == null ? null : _MyPageHelper.TextLayer;
float left = x + Offset.X;
float top = y + Offset.Y+ 12;
float top = y + Offset.Y + sixLinesPerInch;
float bottom = top - height;
image.ScaleAbsoluteWidth(width);
image.ScaleAbsoluteHeight(height);

View File

@ -1352,7 +1352,7 @@ namespace Volian.Print.Library
// B2017-241 Adjust Bottom Message Location for the figure
MyPageHelper.BottomContent = yLocation - (Height * MyPageHelper.YMultiplier);
// B2017-112 Adjust Image Size by Scaler (Used for Facing Pages - Sup Info)
retval = Rtf2Pdf.FigureAt(cb, it_image, XOffset + MyItemInfo.FormatStepData.Font.CharsToTwips, yLocation, Width * MyPageHelper.YMultiplier * ImageScaler, Height * MyPageHelper.YMultiplier * ImageScaler, DebugInfo, yBottomMargin, !MyItemInfo.FormatStepData.Type.Contains("Borderless"), MyItemInfo.ItemID); // C2018-004 added ItemID for create meta file for baseline compares
retval = Rtf2Pdf.FigureAt(cb, it_image, XOffset + MyItemInfo.FormatStepData.Font.CharsToTwips, yLocation, Width * MyPageHelper.YMultiplier * ImageScaler, Height * MyPageHelper.YMultiplier * ImageScaler, DebugInfo, yBottomMargin, !MyItemInfo.FormatStepData.Type.Contains("Borderless"), MyItemInfo.ItemID, SixLinesPerInch); // C2018-004 added ItemID for create meta file for baseline compares
}
catch
{
@ -1407,7 +1407,7 @@ namespace Volian.Print.Library
}
// B2017-241 Adjust Bottom Message Location for the figure
MyPageHelper.BottomContent = yLocation - (Height * MyPageHelper.YMultiplier);
retval = Rtf2Pdf.FigureAt(cb, it_image, XOffset + MyItemInfo.FormatStepData.Font.CharsToTwips, yLocation, Width * MyPageHelper.YMultiplier, Height * MyPageHelper.YMultiplier, DebugInfo, yBottomMargin, !MyItemInfo.FormatStepData.Type.Contains("Borderless"), MyItemInfo.ItemID);
retval = Rtf2Pdf.FigureAt(cb, it_image, XOffset + MyItemInfo.FormatStepData.Font.CharsToTwips, yLocation, Width * MyPageHelper.YMultiplier, Height * MyPageHelper.YMultiplier, DebugInfo, yBottomMargin, !MyItemInfo.FormatStepData.Type.Contains("Borderless"), MyItemInfo.ItemID, SixLinesPerInch);
}
}
// The following code was added to fix B2016-219 (for VCS, the centerline drew through a figure). The 'top' value was taken from the code
@ -3954,7 +3954,7 @@ namespace Volian.Print.Library
}
yoff = AdjustLocIfLongerRNO(itemInfo, yoff, yoffRightParent);
bool noborder = MyItemInfo.FormatStepData.Type.ToUpper().Contains("BORDERLESS");
yoff += (Height + ((noborder ? 2 : 3) * SixLinesPerInch));
yoff += (Height + SixLinesPerInch); // B2019-059 only one extra line after a figure (does not matter if it has a border or not)
CalculateXOffsetGridOrFigure(itemInfo, maxRNO, formatInfo);
}
catch (Exception ex)