Hello! I’m trying to make some dynamic headers by using TextStamps.
The current issue is that my dynamic variable sometimes has long words that don’t have a whitespace to separate them, so the word renders past my MaxRowWidth setting. I was hoping for there to be a word-break property to set, much like word-wrap. Since the text doesn’t break, it sometimes spills over to my other stamps. Do TextStamp or TextState support a method for word-breaking?
var some_really_long_text = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
var top_right_text = "some header goes here";
page.AddStamp(new TextStamp(some_really_long_text)
{
TopMargin = 50,
VerticalAlignment = VerticalAlignment.Top,
HorizontalAlignment = HorizontalAlignment.Center,
WordWrap = true,
Scale = false,
MaxRowWidth = 200,
TextAlignment = HorizontalAlignment.Center,
TextState =
{
HorizontalAlignment = HorizontalAlignment.Justify,
Font = FontRepository.FindFont("Arial"),
ForegroundColor = Color.Black,
FontStyle = FontStyles.Bold,
FontSize = 10.0f
}
});
//adds top-right page text stamp
page.AddStamp(new TextStamp(top_right_text)
{
TopMargin = 50,
RightMargin = half_an_inch,
VerticalAlignment = VerticalAlignment.Top,
HorizontalAlignment = HorizontalAlignment.Right,
WordWrap = true,
Scale = false,
Width = 550 / 3,
TextState =
{
HorizontalAlignment = HorizontalAlignment.Right,
Font = FontRepository.FindFont("Arial"),
ForegroundColor = Color.Black,
FontStyle = FontStyles.Bold,
FontSize = 10.0f
}
});