DocumentDirection
Inhalt
[
Ausblenden
]TxtLoadOptions.DocumentDirection property
Ruft eine Dokumentrichtung ab oder legt sie fest. Der Standardwert istLeftToRight .
public DocumentDirection DocumentDirection { get; set; }
Beispiele
Zeigt, wie die Textrichtung in Klartextdokumenten erkannt wird.
// Erstelle ein "TxtLoadOptions"-Objekt, das wir an den Konstruktor eines Dokuments übergeben können
// um zu ändern, wie wir ein Klartextdokument laden.
TxtLoadOptions loadOptions = new TxtLoadOptions();
// Setzen Sie die Eigenschaft "DocumentDirection" auf "DocumentDirection.Auto" erkennt automatisch
// die Richtung jedes Textabsatzes, den Aspose.Words aus dem Klartext lädt.
// Die „Bidi“-Eigenschaft jedes Absatzes speichert seine Richtung.
loadOptions.DocumentDirection = DocumentDirection.Auto;
// Hebräischen Text als von rechts nach links lesend erkennen.
Document doc = new Document(MyDir + "Hebrew text.txt", loadOptions);
Assert.True(doc.FirstSection.Body.FirstParagraph.ParagraphFormat.Bidi);
// Englischen Text als von rechts nach links lesend erkennen.
doc = new Document(MyDir + "English text.txt", loadOptions);
Assert.False(doc.FirstSection.Body.FirstParagraph.ParagraphFormat.Bidi);
Siehe auch
- enum DocumentDirection
- class TxtLoadOptions
- namensraum Aspose.Words.Loading
- Montage Aspose.Words