LeftIndent

ParagraphFormat.LeftIndent property

Ottiene o imposta il valore (in punti) che rappresenta il rientro sinistro per il paragrafo.

public double LeftIndent { get; set; }

Esempi

Mostra come configurare la formattazione del paragrafo per creare testo decentrato.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Centra tutto il testo scritto dal generatore di documenti e imposta i rientri.
// La configurazione di rientro riportata di seguito creerà un corpo di testo che verrà posizionato in modo asimmetrico sulla pagina.
// Il "centro" rispetto al quale allineiamo il testo sarà la parte centrale del corpo del testo, non la parte centrale della pagina.
ParagraphFormat paragraphFormat = builder.ParagraphFormat;
paragraphFormat.Alignment = ParagraphAlignment.Center;
paragraphFormat.LeftIndent = 100;
paragraphFormat.RightIndent = 50;
paragraphFormat.SpaceAfter = 25;

builder.Writeln(
    "This paragraph demonstrates how left and right indentation affects word wrapping.");
builder.Writeln(
    "The space between the above paragraph and this one depends on the DocumentBuilder's paragraph format.");

doc.Save(ArtifactsDir + "DocumentBuilder.SetParagraphFormatting.docx");

Guarda anche