Modifier and Type | Class and Description |
---|---|
static class |
Document.OutputSettings.Syntax
The output serialization syntax.
|
Constructor and Description |
---|
OutputSettings() |
Modifier and Type | Method and Description |
---|---|
Charset |
charset()
Get the document's current output charset, which is used to control which characters are escaped when generating HTML (via the html() methods), and which are kept intact.
|
Document.OutputSettings |
charset(Charset charset)
Update the document's output charset.
|
Document.OutputSettings |
charset(String charset)
Update the document's output charset.
|
Object |
clone() |
Entities.EscapeMode |
escapeMode()
Get the document's current HTML escape mode: base , which provides a limited set of named HTML entities and escapes other characters as numbered entities for maximum compatibility; or extended , which uses the complete set of HTML named entities.
|
Document.OutputSettings |
escapeMode(Entities.EscapeMode escapeMode)
Set the document's escape mode, which determines how characters are escaped when the output character set does not support a given character:- using either a named or a numbered escape.
|
int |
indentAmount()
Get the current tag indent amount, used when pretty printing.
|
Document.OutputSettings |
indentAmount(int indentAmount)
Set the indent amount for pretty printing
|
boolean |
outline()
Get if outline mode is enabled.
|
Document.OutputSettings |
outline(boolean outlineMode)
Enable or disable HTML outline mode.
|
boolean |
prettyPrint()
Get if pretty printing is enabled.
|
Document.OutputSettings |
prettyPrint(boolean pretty)
Enable or disable pretty printing.
|
Document.OutputSettings.Syntax |
syntax()
Get the document's current output syntax.
|
Document.OutputSettings |
syntax(Document.OutputSettings.Syntax syntax)
Set the document's output syntax.
|
public Entities.EscapeMode escapeMode()
base
, which provides a limited set of named HTML entities and escapes other characters as numbered entities for maximum compatibility; or extended
, which uses the complete set of HTML named entities.
The default escape mode is base
.
public Document.OutputSettings escapeMode(Entities.EscapeMode escapeMode)
escapeMode
- the new escape mode to use
public Charset charset()
html()
methods), and which are kept intact.
Where possible (when parsing from a URL or File), the document's output charset is automatically set to the input charset. Otherwise, it defaults to UTF-8.
public Document.OutputSettings charset(Charset charset)
charset
- the new charset to use.
public Document.OutputSettings charset(String charset)
charset
- the new charset (by name) to use.
public Document.OutputSettings.Syntax syntax()
public Document.OutputSettings syntax(Document.OutputSettings.Syntax syntax)
html
, with empty tags and boolean attributes (etc), or xml
, with self-closing tags.
syntax
- serialization syntax
public boolean prettyPrint()
public Document.OutputSettings prettyPrint(boolean pretty)
pretty
- new pretty print setting
public boolean outline()
public Document.OutputSettings outline(boolean outlineMode)
outlineMode
- new outline setting
public int indentAmount()
public Document.OutputSettings indentAmount(int indentAmount)
indentAmount
- number of spaces to use for indenting each level. Must be >= 0.
Copyright © 1998–2019 iText Group NV. All rights reserved.