To show the table of content I used getOutline() as mentioned in here
this.pdf.getOutline().then((outline: any[]) => {
this.dataSource.data = outline;
});
It is working fine this pdf. But for a few pdf Outline is undefined. I have implemented this ng2-pdf-viewer for those few pdf only.Please help