Hi,
I'm new in this forum and I have started using PDF# a few days ago. I have a problem, in the pdf document I want to draw a string from a rich text box in a rectangle, but when the document is created the string goes out of the page (picture below). I have followed your examples on allining text and using text formatter, on pdf wiki, but with no success.
Here is my code:
PdfDocument doc = new PdfDocument();
doc.Info.Title = "Test";
PdfPage page = doc.AddPage();
XGraphics gfx = XGraphics.FromPdfPage(page);
XFont font = new XFont("Arial", 14, XFontStyle.Regular);
XRect rect = new XRect(60, 75, 350, 150);
gfx.DrawRectangle(XBrushes.Black, rect);
XStringFormat format = new XStringFormat();
gfx.DrawString(rchtxtbxText.Text, font, XBrushes.Red, rect, format);
const string file = "Test.pdf";
doc.Save(@"C:\...\Desktop\" + file);
I would like to know how to draw a string in a rectangle. If someone could help me or give me some examples I would appreciate it. Thanks in advance and sorry for my bad english