TextBuilder.AppendText
İçindekiler
[
Saklamak
]AppendText(TextFragment)
Pdf sayfasına metin parçası ekler
public void AppendText(TextFragment textFragment)
| Parametre | Tür | Açıklama |
|---|---|---|
| textFragment | TextFragment | Metin parçası nesnesi. |
Örnekler
Örnek, metin parçası nesnesi oluşturmayı, metin segmentlerini özelleştirmeyi ve bunu Pdf sayfasına eklemeyi gösterir.
Document doc = new Document(inFile);
Page page = (Page)doc.Pages[1];
// create text fragment
TextFragment tf = new TextFragment("main text");
tf.Position = new Position(100, 600);
// set it's text properties
tf.TextState.FontSize = 5;
tf.TextState.Font = FontRepository.FindFont("TimesNewRoman");
tf.TextState.BackgroundColor = Color.LightGray;
tf.TextState.ForegroundColor = Color.Red;
// add one more segment to text fragment's Segments collection
TextSegment segment2 = new TextSegment();
segment2.Text = "another segment";
tf.Segments.Add(segment2);
// create TextBuilder object
TextBuilder builder = new TextBuilder(page);
// append the text fragment to the Pdf page
builder.AppendText(tf);
//save document
doc.Save(outFile);
Ayrıca Bakınız
- sınıf TextFragment
- sınıf TextBuilder
- ad alanı Aspose.Pdf.Text
- derleme Aspose.PDF
AppendText(List<TextFragment>)
Pdf sayfasına metin parçaları listesini ekler.
public void AppendText(List<TextFragment> textFragments)
| Parametre | Tür | Açıklama |
|---|---|---|
| textFragments | List`1 | Metin parçaları koleksiyonu |
Ayrıca Bakınız
- sınıf TextFragment
- sınıf TextBuilder
- ad alanı Aspose.Pdf.Text
- derleme Aspose.PDF