Is it possible to perform Word to PDF conversion in Azure Environment in ASP.NET MVC application?
Yes, it is possible to perform Word document to PDF conversion in Azure Web sites using Essential® DocIO and PDF libraries.
Step 1:
Create an Azure web site project and refer the below Word document to PDF dependent assemblies on it.
- Syncfusion.Compression.Base.dll
- Syncfusion.OfficeChart.Base.dll
- Syncfusion.DocIO.Base.dll
- Syncfusion.DocToPDFConverter.Base.dll
- Syncfusion.Pdf.Base.dll
- Syncfusion.OfficeChartToImageConverter.Wpf.dll
- Syncfusion.SfChart.WPF.dll
The following code example illustrates how to convert a Word document into PDF document.
C#:
//Loading word document
WordDocument document = new WordDocument(fileName, FormatType.Docx);
document.ChartToImageConverter = new ChartToImageConverter();
DocToPDFConverter converter = new DocToPDFConverter();
//Converts the word document to PDF
PdfDocument pdf = converter.ConvertToPDF(document);
//Saves the PDF document
pdf.Save("WordtoPDF.pdf", Response, HttpReadType.Save);
document.close() ;
VB:
'Loading word document
Dim document As New WordDocument(stream, FormatType.Docx)
document.ChartToImageConverter = New ChartToImageConverter()
Dim converter As New DocToPDFConverter()
'Converts the word document to PDF
Dim pdf As PdfDocument = converter.ConvertToPDF(document)
'Saves the PDF document
pdf.Save("WordtoPDF.pdf", Response, HttpReadType.Save)
document.close()
Know limitation:
The metafile images (*.wmf, *.emf) in Word document are not supported while converting to PDF.
Please make use of the below sample for converting Word document into PDF in Azure environment. This sample is created targeting Azure SDK 2.6.210 and Visual studio 2015.
Sample link:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/SampleAspWebApp-108874911.zip
Hi Suraj,
We recommend you to download our latest Essential Studio 2018 Volume 1 Release v16.1.0.24 from the below link
to get the assemblies.
https://www.syncfusion.com/forums/136049/essential-studio-2018-volume-1-release-v16-1-0-24-is-available-for-download
If you are using ASP.Net Core application, then kindly follow the instructions from
the below KB link and download the sample application which is also compatible
in Azure environment:
https://www.syncfusion.com/kb/8472/how-to-convert-a-word-document-to-pdf-in-asp-net-core-application
Regards,
Mohanaselvam J
dlls are currupted after downloading project. How we will know it is working or not?
and how we will get those DLL to add in our project?