We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

saveAsBlob Format PDF

Thread ID:

Created:

Updated:

Platform:

Replies:

142060 Jan 17,2019 04:39 AM UTC Jan 17,2019 11:47 AM UTC Angular - EJ 2 1
loading
Tags: DocumentEditor
Erwin Herdiansyah
Asked On January 17, 2019 04:39 AM UTC

is it possible to use the saveAsBlob method in pdf format (saveAsBlob ("Pdf")) or something that can convert word documents to pdf on the client side ?


Karthikeyan Chandrasekar [Syncfusion]
Replied On January 17, 2019 11:47 AM UTC

Hi John,  
Thanks for contacting Syncfusion support.  
At present, we don’t have support for converting word document to pdf in client side. We have logged this as feature request in our database. We will implement this feature in any of our upcoming releases. We will update you when this feature has been implemented.  

But we have support for converting word document to pdf in server side by sending the document to web server as demonstrated in in below link.  
Client Side:  

Server Side:  
Please find C# code to convert word to pdf and send it back to client side  
public IActionResult DocToPDF(IFormCollection data)  
{  
    Stream stream = new MemoryStream();  
    IFormFile file = data.Files[0];  
    var fileName = file.FileName;  
    file.CopyTo(stream);  
    stream.Position = 0;  
    Syncfusion.DocIO.DLS.WordDocument wordDocument = newSyncfusion.DocIO.DLS.WordDocument(stream, Syncfusion.DocIO.FormatType.Docx);  
    //Instantiation of DocIORenderer for Word to PDF conversion  
    DocIORenderer render = new DocIORenderer();  
    //Converts Word document into PDF document  
    PdfDocument pdfDocument = render.ConvertToPDF(wordDocument);  
    //Saves the PDF file  
    MemoryStream outputStream = new MemoryStream();  
    pdfDocument.Save(outputStream);  
    //Closes the instance of PDF document object  
    outputStream.Position = 0;  
    render.Dispose();  
    wordDocument.Dispose();  
    return File(outputStream, "application/pdf", fileName + ".pdf");  
}  
  
 
Regards,  
Karthikeyan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon