Internal and External Links |
Select.Pdf Library can convert internal html links to internal pdf links and keep external html links (hyperlinks to other pages) the same in pdf (external links). These links can be disabled in pdf if needed.
There are 2 properties that can be used to enable and disable internal and external links:
InternalLinksEnabled - Controls the conversion of internal html links to internal pdf links. The default value for this property is True.
ExternalLinksEnabled - Controls the rendering of external hyperlinks in pdf. The default value for this property is True.
This sample code shows how the html to pdf converter can handle internal and external links from the web page when converted to pdf using Select.Pdf Pdf Library for .NET.
// instantiate a html to pdf converter object HtmlToPdf converter = new HtmlToPdf(); // set links options converter.Options.InternalLinksEnabled = true; converter.Options.ExternalLinksEnabled = true; // create a new pdf document converting an url PdfDocument doc = converter.ConvertUrl(TxtUrl.Text); // save pdf document doc.Save(Response, false, "Sample.pdf"); // close pdf document doc.Close();