public class Underline
Example:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("For more information, please visit the ");
// Insert a hyperlink, and apply formatting to emphasize it.
// The hyperlink will be a clickable piece of text which will take us to the location specified in the URL.
builder.getFont().setColor(Color.BLUE);
builder.getFont().setUnderline(Underline.SINGLE);
builder.insertHyperlink("Aspose website", "http://www.aspose.com", false);
builder.getFont().clearFormatting();
builder.writeln(".");
// Ctrl + left clicking the link in the text in Microsoft Word will take us to the URL via a new web browser window.
doc.save(getArtifactsDir() + "DocumentBuilder.InsertHyperlink.docx");
Field Summary | ||
---|---|---|
static final int | NONE | |
static final int | SINGLE | |
static final int | WORDS | |
static final int | DOUBLE | |
static final int | DOTTED | |
static final int | THICK | |
static final int | DASH | |
static final int | DASH_LONG | |
static final int | DOT_DASH | |
static final int | DOT_DOT_DASH | |
static final int | WAVY | |
static final int | DOTTED_HEAVY | |
static final int | DASH_HEAVY | |
static final int | DASH_LONG_HEAVY | |
static final int | DOT_DASH_HEAVY | |
static final int | DOT_DOT_DASH_HEAVY | |
static final int | WAVY_HEAVY | |
static final int | WAVY_DOUBLE | |
public static final int NONE
public static final int SINGLE
public static final int WORDS
public static final int DOUBLE
public static final int DOTTED
public static final int THICK
public static final int DASH
public static final int DASH_LONG
public static final int DOT_DASH
public static final int DOT_DOT_DASH
public static final int WAVY
public static final int DOTTED_HEAVY
public static final int DASH_HEAVY
public static final int DASH_LONG_HEAVY
public static final int DOT_DASH_HEAVY
public static final int DOT_DOT_DASH_HEAVY
public static final int WAVY_HEAVY
public static final int WAVY_DOUBLE