John f7cb594d76 added check for null MacroDef
additional checks for checkoffs and logic support or NSP script Cautions with bullets
fixed pagelist processing issue when pagelist row has more than one token
support for NSP script Cautions
fixed problem where the END message was not printing for NSP (the Y location was negative – off the page)
2011-12-07 14:04:53 +00:00

54 lines
1.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using iTextSharp.text.pdf;
using iTextSharp.text;
using VEPROMS.CSLA.Library;
namespace Volian.Print.Library
{
public partial class vlnText : vlnPrintObject
{
//public float Width
//{
// get { return _CharsToTwips * Text.Length; }
//}
private string _Text;
public string Text
{
get { return _Text; }
set { _Text = value; }
}
private VE_Font _MyFont;
public VE_Font MyFont
{
get { return _MyFont; }
set { _MyFont = value; }
}
public vlnText(PdfContentByte cb, vlnParagraph myparent, string origText, string cleanText, float xoffset, float yoffset, VE_Font vFont)
{
MyContentByte = cb;
MyParent = myparent;
YOffset = yoffset;
Text = cleanText;
Rtf = GetRtf(origText, vFont);
XOffset = xoffset;
MyFont = vFont;
Width = MyFont.CharsToTwips * (Text.Length + 2);
}
public vlnText()
{
}
public override float ToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin)
{
// The END message was not printing for NSP. The yLocation was getting set to a negative number, thus printing off the page.
// Found that the YOffset, cacluated when the bottom message was created, is really the actual location, at least in this case.
float yLocation = CalculateYOffset(yPageStart, yTopMargin);
if (yLocation < 0) yLocation = YOffset;
Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, "", yBottomMargin);
return yPageStart;
}
}
}