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. Image for the cookie policy date
close icon

Cannot convert from doc / docx to pdf

HI team how can i convert doc/ docx to pdf 
my data saving in  azure 

this is my code( i am converting doc file into pdf and stoe that into a list after this i need to mearge all pdfs into singel and saved to azure )


 if (lstDocFileNames.Count > 0)
                {
                    for (int i = 0; i < lstDocFileNames.Count; i++)
                    {
                        WordDocument wordDoc = new WordDocument(strLocalUploadedDocumentsFolderPath + "\\" + lstDocFileNames[i]);
                        DocToPDFConverter converter = new DocToPDFConverter();

                        // Convert word document into PDF document
                        PdfDocument pdfDoc = converter.ConvertToPDF(wordDoc);

                        // Save the pdf file to Local folder
                        pdfDoc.Save(strLocalUploadedDocumentsFolderPath + "\\" + lstDocFileNames[i].Split('.').First() + ".pdf");

                        if (LocalFiles.Count() > 0)
                        {
                            for (int j = 0; j < LocalFiles.Count(); j++)
                            {
                                if (LocalFiles[j] == null || LocalFiles[j] == string.Empty)
                                {
                                    LocalFiles[j] = strLocalUploadedDocumentsFolderPath + "\\" + lstDocFileNames[i].Split('.').First() + ".pdf";//Keep the file, in which order they have sent to merge
                                    break;
                                }
                            }
                        }
                    }
                }


1 Reply

SR Suganya Rathinam Syncfusion Team April 26, 2016 01:02 PM UTC

Hi Chaitanya,

On further analyzing your requirement, we suspect that you are trying to use the Azure web sites in your LightSwitch Silverlight projects to save the merged PDF file which is converted from Word document. Currently DocIO does not have support for Word to PDF conversion in Windows Azure web sites and LightSwitch Silverlight platform. Since DocIO uses meta file and GDI functionality for Word to PDF conversion which is not supported in Windows Azure web sites and LightSwitch Silverlight platform.

So, we suggest you to use any Azure cloud service as background service to convert Word document to PDF, PDF merging process and deploy this service in your LightSwitch Silverlight project. Kindly confirm whether our suggestion suits your requirement or not? If it does not suite, then kindly provide the clear workflow details about your requirement. So that we can analyze further and provide you appropriate solution at the earliest.

Regards,
Suganya


Loader.
Live Chat Icon For mobile
Up arrow icon