procedure AddText(const Text, Font: WString; FontSize: Single; X, Y: Double; Color: TColor = clBlack; Alpha: Byte = $FF; Angle: Double = 0.0);
| FontSize | Single. Font size in points (e.g. 12.0 for 12 pt text). |
| Color | TColor. Text fill color. Default is clBlack. |
| Alpha | Byte. Deckkraft des Textes, wobei $00 vollständig transparent und $FF vollständig opak ist. Standard ist $FF |
| Angle | Double. Rotation angle in degrees, measured counterclockwise from the positive X axis. Default is 0.0 (horizontal). |
AddText rendert eine Unicode-Textzeichenfolge auf die aktuelle PDF-Seite mit der angegebenen Schriftart und Größe. Die Position (X, Y) ist der Basispunkt des ersten Zeichens, gemessen in PDF-User-Units von der linken unteren Ecke der Seite aus (Ursprung unten links, Y wächst nach oben)
The font is identified by its PostScript or family name (e.g. 'Arial', 'Times New Roman'). Die Schriftart muss auf dem System verfügbar oder im Dokument eingebettet sein; wenn PDFium die angeforderte Schriftart nicht finden kann, ersetzt es sie durch eine Standardschriftart
Use the Color and Alpha parameters to control the appearance of the text fill. Set Alpha to a value less than $FF to render semi-transparent text. The Angle parameter rotates the entire text string counterclockwise around the baseline origin.
Diese Methode fügt den Text als neues Seitenobjekt hinzu. Um den Inhalt eines vorhandenen Textobjekts nach dem Hinzufügen zu ändern, verwenden Sie SetText.
// Add a title string near the top of an A4 page
// A4 page height = 841.89 pt; place text 50 pt from the top
Pdf1.NewPage(595, 842);
Pdf1.AddText('Hello, PDFiumPas!', 'Arial', 24, 72, 768);
// Red text at 45 degrees with 50% opacity
Pdf1.AddText('Rotated', 'Arial', 18, 200, 400, clRed, $80, 45);