com.aspose.words

Class DropCapPosition

  • java.lang.Object
    • com.aspose.words.DropCapPosition
public class DropCapPosition 
extends java.lang.Object

Utility class containing constants. Specifies the position for a drop cap text.

Example:

Shows how to set the position of a drop cap.
// Create a blank document
Document doc = new Document();

// Every paragraph has its own drop cap setting
Paragraph para = doc.getFirstSection().getBody().getFirstParagraph();

// By default, it is "none", for no drop caps
Assert.assertEquals(para.getParagraphFormat().getDropCapPosition(), com.aspose.words.DropCapPosition.NONE);

// Move the first capital to outside the text margin
para.getParagraphFormat().setDropCapPosition(com.aspose.words.DropCapPosition.MARGIN);
para.getParagraphFormat().setLinesToDrop(2);

// This text will be affected
para.getRuns().add(new Run(doc, "Hello World!"));

doc.save(getArtifactsDir() + "Paragraph.DropCap.docx");

Field Summary
static final intNONE = 0
The paragraph does not have a drop cap.
static final intNORMAL = 1
The drop cap is positioned inside the text margin on the anchor paragraph.
static final intMARGIN = 2
The drop cap is positioned outside the text margin on the anchor paragraph.
 

    • Field Detail

      • NONE = 0

        public static final int NONE
        The paragraph does not have a drop cap.
      • NORMAL = 1

        public static final int NORMAL
        The drop cap is positioned inside the text margin on the anchor paragraph.
      • MARGIN = 2

        public static final int MARGIN
        The drop cap is positioned outside the text margin on the anchor paragraph.