public class HyphenationOptions
Example:
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");
Constructor Summary |
---|
Property Getters/Setters Summary | ||
---|---|---|
boolean | getAutoHyphenation() | |
void | setAutoHyphenation(booleanvalue) | |
Gets or sets value determining whether automatic hyphenation is turned on for the document. Default value for this property is false. | ||
int | getConsecutiveHyphenLimit() | |
void | setConsecutiveHyphenLimit(intvalue) | |
Gets or sets the maximum number of consecutive lines that can end with hyphens. Default value for this property is 0. | ||
boolean | getHyphenateCaps() | |
void | setHyphenateCaps(booleanvalue) | |
Gets or sets value determining whether words written in all capital letters are hyphenated. Default value for this property is true. | ||
int | getHyphenationZone() | |
void | setHyphenationZone(intvalue) | |
Gets or sets the distance in 1/20 of a point from the right margin within which you do not want to hyphenate words. Default value for this property is 360 (0.25 inch). |
public boolean getAutoHyphenation() / public void setAutoHyphenation(boolean value)
Example:
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 int getConsecutiveHyphenLimit() / public void setConsecutiveHyphenLimit(int value)
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.
Example:
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 boolean getHyphenateCaps() / public void setHyphenateCaps(boolean value)
Example:
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 int getHyphenationZone() / public void setHyphenationZone(int value)
Example:
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");