51 lines
1.2 KiB
C#
51 lines
1.2 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)
|
|
{
|
|
float yLocation = CalculateYOffset(yPageStart, yTopMargin);
|
|
Rtf2Pdf.TextAt(cb, IParagraph, XOffset, YOffset, Width, 100, "", yBottomMargin);
|
|
return yPageStart;
|
|
}
|
|
}
|
|
}
|