TextFragment Class
A text fragment on a PDF page.
Namespace: DevExpress.Docs.Pdf
Assembly: DevExpress.Docs.Pdf.v26.1.dll
Declaration
Related API Members
The following members return TextFragment objects:
Example
How to: Add Formatted Text to a PDF Document
The following code snippet adds a single line of text to a PDF document page:

using DevExpress.Docs.Pdf;
using DevExpress.Drawing.Printing;
using System.Drawing;
using DevExpress.Drawing;
using System.IO;
using (PdfDocument pdfDocument = new PdfDocument()) {
var page = pdfDocument.Pages.Add(DXPaperKind.A4);
// Create a text fragment with formatting.
var text = new TextFragment()
{
Text = "The PDF Document API",
Location = new PointF(10, 740),
Font = new DXFont("Courier New", 11, DXFontStyle.Regular),
};
page.AddFragment(text);
pdfDocument.Save(new FileStream("Result.pdf", FileMode.Create, FileAccess.Write));
}
Implements
Inheritance
See Also