New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Disabling Hyperlinks and Mailto URLS in the produced PDF

Environment

Product RadClientExportManager for ASP.NET AJAX

Description

Learn how to disable the hyperlinks when you export content in PDF with the RadClientExportManager control.

Solution

Since R2 2022, the AvoidLinks server property is available built-in in RadClientExportManager's PdfSettings inner tag.

In the underlying Kendo Drawing API there is a configuration setting called avoidLinks: true which you can enable in RadClientExportManager as shown below:

<div id="foo">
    <a href="https://www.google.com">Google</a>
    <br />
    <a href="mailto:someone@yoursite.com">Email Us</a>
</div>

<telerik:RadClientExportManager runat="server" ID="RadClientExportManager1">
</telerik:RadClientExportManager>
<input type="button" onclick="exportElement()" value="export" />

<script type="text/javascript">
    function exportElement() {
        var pdfSettings = {
            fileName: "PDF-Export",
            avoidLinks: true,
            margin: { top: 25, left: 15, bottom: 10, right: 5 },
            paperSize: "A4",
            landscape: false,
            title: "PDF",
            author: "UserName",
            subject: "Export to PDF",
            keywords: "a keyword",
            creator: "John",
            date: new Date(2015, 10, 25)
        };
        var exp = $find("<%= RadClientExportManager1.ClientID %>");
        exp.exportPDF($telerik.$("#foo"), pdfSettings);
    }
</script>
In this article