Thu May 28, 2020 8:09 am
Hi, thank you for your quickly response.
the text I want to fit is:
"Al cambiar de rama <<<<<<<<1>>>>>>>> y hacer el merge a través de fetch he <<<<<<<<1>>>>>>>> introducido fallos en el proyecto. Paco Ramirez me ha ayudado a corregirlos y ya está disponible el proyecto correctamente. Voy a probar el compo Buenos días:"
Where "<<<<<<<<1>>>>>>>>" is the custom tag I'm talking about.
And the fragment code I used:
"
PdfStringFormat format = new PdfStringFormat(PdfTextAlignment.Left);
format.LineSpacing = 10f;
PdfStringLayouter stringLayout = new PdfStringLayouter();
PdfStringLayoutResult result = stringLayout.Layout(text, font2, format, new SizeF(document.Pages[pageCount - 1].GetClientSize().Width / (1.22f), 0));
PointF position = new PointF(0, Y);
foreach (LineInfo line in result.Lines)
{
document.Pages[pageCount - 1].Canvas.DrawString(line.Text, fontBodyRegular, PdfBrushes.Black, position, format);
position.Y = position.Y + result.LineHeight;
if ((position.Y + result.LineHeight + format.LineSpacing * 10) > document.Pages[pageCount - 1].ActualSize.Height)
{
pageCount = CreateHeader(document, formula, material, true);
Y = 60f;
position = new PointF(0, Y);
}
}
"
I tried to set the attribute WordWrap of PdfStringFormat at true, but still not working.
If you need more information, don't worry in telling me.
Thanks.