diff --git a/PROMS/Volian.Print.Library/vlnPrintObject.cs b/PROMS/Volian.Print.Library/vlnPrintObject.cs
index ea896254..9a8a24b0 100644
--- a/PROMS/Volian.Print.Library/vlnPrintObject.cs
+++ b/PROMS/Volian.Print.Library/vlnPrintObject.cs
@@ -31,7 +31,6 @@ namespace Volian.Print.Library
protected static float _WidthAdjust = 1; // 1 Point - adjusted to match 16-bit line wrapping. For editting it's 3.
protected static float _WidthAdjustBox = 6;
- protected static float _CharsToTwips = 6; // assumes 12 char per inch
private static float _SixLinesPerInch = 12; // twips
public static float SixLinesPerInch
{
@@ -44,7 +43,7 @@ namespace Volian.Print.Library
public float XOffset
{
get { return _XOffset; }
- set { _XOffset = value; }
+ set {_XOffset = value; }
}
protected float _YOffset;
public float YOffset
@@ -120,14 +119,15 @@ namespace Volian.Print.Library
//myColumnText.UseAscender = true;// Adjusts to the top of the text box.
int status = myColumnText.Go(true); // Check to see if it will fit on the page.
if (ColumnText.HasMoreText(status) && throwException)
- throw (new Exception("Paragraph longer than a page"));
+ //throw (new Exception("Paragraph longer than a page"));
+ Console.WriteLine("Paragraph longer than a page");
return 792F - myColumnText.YLine; // This gives the height of the Paragraph
}
- public static float GetTableWidth(PdfContentByte cb, Paragraph iParagraph)
+ public static float GetTableWidth(PdfContentByte cb, Paragraph iParagraph, float? maxWidth)
{
- int iWidth = 128 * (int) _CharsToTwips; // maximum width in Characters
+ int iWidth = (int)(maxWidth ?? 72 * 8.5F);
float h = GetParagraphHeight(cb, iParagraph, iWidth);
- int iWidthMax = iWidth;
+ int iWidthMax = iWidth; // maximum width in Characters
int iDelta = iWidth / 2;
iWidth = iWidth / 2;
while (iDelta > 0)
@@ -184,7 +184,7 @@ namespace Volian.Print.Library
///
public static int ToInt(string value)
{
- return ToInt(Convert.ToInt32(value));
+ return ToInt((int)Convert.ToSingle(value));
}
///
/// No conversion necessary: value from a list in a string, twips -> int twips
@@ -196,12 +196,6 @@ namespace Volian.Print.Library
string s = value.Split(",".ToCharArray())[i];
return ToInt(s);
}
- public float AdjustToCharPosition(float position)
- {
- int iPosition = (int)position;
- iPosition = (iPosition / (int)_CharsToTwips) * (int)_CharsToTwips;
- return (float)iPosition;
- }
public static string GetRtf(string text, VE_Font vFont)
{
StringBuilder rtfSB = new StringBuilder();
diff --git a/PROMS/Volian.Print.Library/vlnRNOSeparator.cs b/PROMS/Volian.Print.Library/vlnRNOSeparator.cs
index 3cf59df0..79777eb6 100644
--- a/PROMS/Volian.Print.Library/vlnRNOSeparator.cs
+++ b/PROMS/Volian.Print.Library/vlnRNOSeparator.cs
@@ -35,7 +35,7 @@ namespace Volian.Print.Library
else
Rtf = "--------------------------"; //TODO - What should this be: is this Ctrl-A?
MyFont = formatInfo.PlantFormat.FormatData.Font;
- Width = sepStr.Length * _CharsToTwips + _WidthAdjust;
+ Width = sepStr.Length * MyFont.CharsToTwips + _WidthAdjust;
}
public override float ToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin)
{