Hi ,
I am trying to draw string in pdf using drawstring method. I certain cases, my text exceeds the width of my textbox. Hence I tried using SetClip for clipping the text. I dont want to use wordwrap since clipping is all the client needs. Please see the below code that I am using
var format = new PdfStringFormat
{
LineLimit = false,
WordWrap = wordWrap ? PdfWordWrapType.Word : PdfWordWrapType.None,
Alignment = alignment.ToPdfTextAlignment(),
LineAlignment = vAlign.ToPdfVerticalAlignment()
};
graphics.SetClip(new RectangleF((float)effectiveX, (float)effectiveY, (float)effectiveWidth,
(float)effectiveHeight));
graphics.DrawString(text, font,color, new RectangleF((float)effectiveX, (float)effectiveY, (float)effectiveWidth,
(float)effectiveHeight),format);
Am I doing it right?