public class HyphenationOptions
extends java.lang.Object
implements java.lang.Cloneable
To learn more, visit the Working with Hyphenation documentation article.
Examples:
Shows how to configure automatic hyphenation.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.getFont().setSize(24.0);
builder.writeln("Lorem ipsum dolor sit amet, consectetur adipiscing elit, " +
"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
doc.getHyphenationOptions().setAutoHyphenation(true);
doc.getHyphenationOptions().setConsecutiveHyphenLimit(2);
doc.getHyphenationOptions().setHyphenationZone(720);
doc.getHyphenationOptions().setHyphenateCaps(true);
doc.save(getArtifactsDir() + "Document.HyphenationOptions.docx");
| Modifier and Type | Method and Description |
|---|---|
boolean |
getAutoHyphenation()
Gets value determining whether automatic hyphenation is turned on for the document.
|
int |
getConsecutiveHyphenLimit()
Gets the maximum number of consecutive lines that can end with hyphens.
|
boolean |
getHyphenateCaps()
Gets value determining whether words written in all capital letters are hyphenated.
|
int |
getHyphenationZone()
Gets the distance in 1/20 of a point from the right margin within which you do not want to hyphenate words.
|
protected java.lang.Object |
memberwiseClone() |
void |
setAutoHyphenation(boolean value)
Sets value determining whether automatic hyphenation is turned on for the document.
|
void |
setConsecutiveHyphenLimit(int value)
Sets the maximum number of consecutive lines that can end with hyphens.
|
void |
setHyphenateCaps(boolean value)
Sets value determining whether words written in all capital letters are hyphenated.
|
void |
setHyphenationZone(int value)
Sets the distance in 1/20 of a point from the right margin within which you do not want to hyphenate words.
|
public boolean getAutoHyphenation()
false.
Examples:
Shows how to configure automatic hyphenation.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.getFont().setSize(24.0);
builder.writeln("Lorem ipsum dolor sit amet, consectetur adipiscing elit, " +
"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
doc.getHyphenationOptions().setAutoHyphenation(true);
doc.getHyphenationOptions().setConsecutiveHyphenLimit(2);
doc.getHyphenationOptions().setHyphenationZone(720);
doc.getHyphenationOptions().setHyphenateCaps(true);
doc.save(getArtifactsDir() + "Document.HyphenationOptions.docx");
public void setAutoHyphenation(boolean value)
false.
Examples:
Shows how to configure automatic hyphenation.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.getFont().setSize(24.0);
builder.writeln("Lorem ipsum dolor sit amet, consectetur adipiscing elit, " +
"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
doc.getHyphenationOptions().setAutoHyphenation(true);
doc.getHyphenationOptions().setConsecutiveHyphenLimit(2);
doc.getHyphenationOptions().setHyphenationZone(720);
doc.getHyphenationOptions().setHyphenateCaps(true);
doc.save(getArtifactsDir() + "Document.HyphenationOptions.docx");
value - Value determining whether automatic hyphenation is turned on for the document.public int getConsecutiveHyphenLimit()
Remarks:
If value of this property is set to 0, any number of consecutive lines can end with hyphens.
The property does not have effect when saving to fixed page formats e.g. PDF.
Examples:
Shows how to configure automatic hyphenation.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.getFont().setSize(24.0);
builder.writeln("Lorem ipsum dolor sit amet, consectetur adipiscing elit, " +
"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
doc.getHyphenationOptions().setAutoHyphenation(true);
doc.getHyphenationOptions().setConsecutiveHyphenLimit(2);
doc.getHyphenationOptions().setHyphenationZone(720);
doc.getHyphenationOptions().setHyphenateCaps(true);
doc.save(getArtifactsDir() + "Document.HyphenationOptions.docx");
public void setConsecutiveHyphenLimit(int value)
Remarks:
If value of this property is set to 0, any number of consecutive lines can end with hyphens.
The property does not have effect when saving to fixed page formats e.g. PDF.
Examples:
Shows how to configure automatic hyphenation.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.getFont().setSize(24.0);
builder.writeln("Lorem ipsum dolor sit amet, consectetur adipiscing elit, " +
"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
doc.getHyphenationOptions().setAutoHyphenation(true);
doc.getHyphenationOptions().setConsecutiveHyphenLimit(2);
doc.getHyphenationOptions().setHyphenationZone(720);
doc.getHyphenationOptions().setHyphenateCaps(true);
doc.save(getArtifactsDir() + "Document.HyphenationOptions.docx");
value - The maximum number of consecutive lines that can end with hyphens.public int getHyphenationZone()
Examples:
Shows how to configure automatic hyphenation.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.getFont().setSize(24.0);
builder.writeln("Lorem ipsum dolor sit amet, consectetur adipiscing elit, " +
"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
doc.getHyphenationOptions().setAutoHyphenation(true);
doc.getHyphenationOptions().setConsecutiveHyphenLimit(2);
doc.getHyphenationOptions().setHyphenationZone(720);
doc.getHyphenationOptions().setHyphenateCaps(true);
doc.save(getArtifactsDir() + "Document.HyphenationOptions.docx");
public void setHyphenationZone(int value)
Examples:
Shows how to configure automatic hyphenation.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.getFont().setSize(24.0);
builder.writeln("Lorem ipsum dolor sit amet, consectetur adipiscing elit, " +
"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
doc.getHyphenationOptions().setAutoHyphenation(true);
doc.getHyphenationOptions().setConsecutiveHyphenLimit(2);
doc.getHyphenationOptions().setHyphenationZone(720);
doc.getHyphenationOptions().setHyphenateCaps(true);
doc.save(getArtifactsDir() + "Document.HyphenationOptions.docx");
value - The distance in 1/20 of a point from the right margin within which you do not want to hyphenate words.public boolean getHyphenateCaps()
true.
Examples:
Shows how to configure automatic hyphenation.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.getFont().setSize(24.0);
builder.writeln("Lorem ipsum dolor sit amet, consectetur adipiscing elit, " +
"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
doc.getHyphenationOptions().setAutoHyphenation(true);
doc.getHyphenationOptions().setConsecutiveHyphenLimit(2);
doc.getHyphenationOptions().setHyphenationZone(720);
doc.getHyphenationOptions().setHyphenateCaps(true);
doc.save(getArtifactsDir() + "Document.HyphenationOptions.docx");
public void setHyphenateCaps(boolean value)
true.
Examples:
Shows how to configure automatic hyphenation.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.getFont().setSize(24.0);
builder.writeln("Lorem ipsum dolor sit amet, consectetur adipiscing elit, " +
"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
doc.getHyphenationOptions().setAutoHyphenation(true);
doc.getHyphenationOptions().setConsecutiveHyphenLimit(2);
doc.getHyphenationOptions().setHyphenationZone(720);
doc.getHyphenationOptions().setHyphenateCaps(true);
doc.save(getArtifactsDir() + "Document.HyphenationOptions.docx");
value - Value determining whether words written in all capital letters are hyphenated.protected java.lang.Object memberwiseClone()