RTE PDF Table of Contents

Hi guys,

I am using the Rich Text Editor in Angular 4 project to allow users to enter formatted text, which i will eventually want them to generate a pdf for.

However what i also want is to generate a table of contents based on the heading styles.

Does anyone have any ideas if this is possible and if so how to go about it?

1 Reply

PO Prince Oliver Syncfusion Team October 26, 2017 09:40 AM UTC

Hi Craig, 

Thank you for contacting Syncfusion forums. 

We have a PDF export functionality in our RTE control where we can convert the contents of RTE into a PDF file. Refer to the following code. 

[HTML] 
<textarea ej-rte width="100%" height="300px" [(value)]="content" [tools]= "tools" [exportToPdfSettings]="exportpdf" > 
    </textarea> 


[TS] 
    content: string; 
    tools: any; 
    exportpdf: Object; 
    constructor() { 
        this.content = 'Description: The Rich Text Editor (RTE) control is an easy to render in client side. Customer easy to edit the contents and get the HTML content from RTE'; 
        this.tools = { 
            importExport: ["pdfExport"] 
        }; 
        this.exportpdf = { url: "http://js.syncfusion.com/demos/ejServices/api/RTE/PdfExport", fileName: "PdfSample" }; 
    } 


For PDF export, you need to process the HTML to PDF conversion using a server-side handler. For more information on import and export feature, kindly refer to the following UG link: https://help.syncfusion.com/angular/richtexteditor/importandexport 


Regards, 
Prince 



Loader.
Up arrow icon