convert generated html code by Rich Text Editor Control to PDF

hi 
i want convert html code that generated by Rich Text Editor Control to pdf and save Pdf file to server 



1 Reply 1 reply marked as answer

IS Indrajith Srinivasan Syncfusion Team June 30, 2020 02:56 PM UTC

Hi Devparsafardd, 
 
Greetings from Syncfusion support, 
 
We have validated your reported query. You can get the RichTextEditor conten using the ejs-for in the server and save the Html value returned as PDF. We have also prepared a sample that tried to meet your requirements of retriving the HTML content from the editor. 
 
Index.cshtml 
 
 
@model WebApplication4.Controllers.HomeController 
 
<form method="post"> 
    <div class="form-group"> 
        <div class="RTE_wrap"> 
            <ejs-richtexteditor ejs-for="@Model.RteValue" id="defaultRTE"> 
            </ejs-richtexteditor> 
        </div>         
    </div> 
    <br /> 
    <button type="submit" class="e-btn">DownLoad as PDF</button> 
</form> 
 


 
HomeController.cs 
 
 
  [HttpPost] 
  public IActionResult Index(string RteValue) 
  { 
      //RTE HTML value returned 
      var valueRTE = RteValue; 
     return View(); 
} 
 
 
Refer the documentation for converting the received HTML from Rich Text Editor to save as PDF: https://help.syncfusion.com/file-formats/pdf/converting-html-to-pdf   
 
Please let us know if the solution helps, 
 
Regards, 
Indrajith 


Marked as answer
Loader.
Up arrow icon