PdfSaveOptionsOpenHyperlinksInNewWindow Property

Gets or sets a value determining whether hyperlinks in the output Pdf document are forced to be opened in a new window (or tab) of a browser.

Namespace:  Aspose.Words.Saving
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public bool OpenHyperlinksInNewWindow { get; set; }

Property Value

Type: Boolean
Remarks

The default value is false. When this value is set to true hyperlinks are saved using JavaScript code. JavaScript code is app.launchURL("URL", true);, where URL is a hyperlink.

Note that if this option is set to true hyperlinks can't work in some PDF readers e.g. Chrome, Firefox.

Examples
Shows how to escape hyperlinks or not in the document.
DocumentBuilder builder = new DocumentBuilder();
builder.InsertHyperlink("Testlink", uri, false);

// Set this property to false if you are sure that hyperlinks in document's model are already escaped
PdfSaveOptions options = new PdfSaveOptions();
options.EscapeUri = isEscaped;
options.OpenHyperlinksInNewWindow = true;

builder.Document.Save(ArtifactsDir + "PdfSaveOptions.EscapedUri.pdf", options);
See Also