com.aspose.words
Class DocumentDirection

java.lang.Object
    extended by com.aspose.words.DocumentDirection

public class DocumentDirection 
extends java.lang.Object

Utility class containing constants. Allows to specify the direction to flow the text in a document.

Example:

Shows how to detect plaintext document text direction.
// Create a "TxtLoadOptions" object, which we can pass to a document's constructor
// to modify how we load a plaintext document.
TxtLoadOptions loadOptions = new TxtLoadOptions();

// Set the "DocumentDirection" property to "DocumentDirection.Auto" automatically detects
// the direction of every paragraph of text that Aspose.Words loads from plaintext.
// Each paragraph's "Bidi" property will store its direction.
loadOptions.setDocumentDirection(DocumentDirection.AUTO);

// Detect Hebrew text as right-to-left.
Document doc = new Document(getMyDir() + "Hebrew text.txt", loadOptions);

Assert.assertTrue(doc.getFirstSection().getBody().getFirstParagraph().getParagraphFormat().getBidi());

// Detect English text as right-to-left.
doc = new Document(getMyDir() + "English text.txt", loadOptions);

Assert.assertFalse(doc.getFirstSection().getBody().getFirstParagraph().getParagraphFormat().getBidi());

Field Summary
static final intLEFT_TO_RIGHT = 0
           Left to right direction.
static final intRIGHT_TO_LEFT = 1
           Right to left direction.
static final intAUTO = 2
           Auto-detect direction.
 

Field Detail

LEFT_TO_RIGHT = 0

public static final int LEFT_TO_RIGHT
Left to right direction.

RIGHT_TO_LEFT = 1

public static final int RIGHT_TO_LEFT
Right to left direction.

AUTO = 2

public static final int AUTO
Auto-detect direction. When this option is selected and text contains characters belonging to RTL scripts, the document direction will be set automatically to RTL.

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.