Disabling Hyperlinks

By default, the drawDOM method creates clickable hyperlinks in the generated PDF document.

To disable the hyperlinks, use the avoidLinks option.

For more information on how to disable hyperlinks with the PDF Export component, refer to its documentation.

import { Component } from '@angular/core';
import { exportElement } from './export-element';

@Component({
  selector: 'my-app',
  template: `
    <button (click)="onClick(drawMe)">Export PDF...</button>
    <div #drawMe>
        This is <a href="http://www.telerik.com/kendo-angular-ui/">a non-clickable link</a>.
    </div>
  `
})
export class AppComponent {
  public onClick(element) {
    exportElement(element, {
        avoidLinks: true
    });
  }
}

import { drawDOM, exportPDF, DrawOptions, Group } from '@progress/kendo-drawing';
import { saveAs } from '@progress/kendo-file-saver';

export function exportElement(element: HTMLElement, options?: DrawOptions) {
    drawDOM(element, options).then((group: Group) => {
        return exportPDF(group);
    }).then((dataUri) => {
        saveAs(dataUri, 'export.pdf');
    });
}

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';

@NgModule({
  imports:      [ BrowserModule ],
  declarations: [ AppComponent ],
  bootstrap:    [ AppComponent ]
})
export class AppModule { }

import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';

enableProdMode();
platformBrowserDynamic().bootstrapModule(AppModule);

In this article