Is there any way to convert .docx to pdf using Aspose.Words

Hi,

In my Sharepoint Site, I want to convert both doc files as well as docx files to Pdf format. I referred the below link

https://docs.aspose.com/words/sharepoint/convert-one-file/

I got the pdf files in some cases and in some cases the pdf file is not generated. The Option Convert To Pdf works only for doc files and the context menu is disabled in case of docx files. I want to do both conversions using the same exe. i modified Elements.xml file like this

<DocumentConverter Id="{0CCBC151-D68C-4925-ACCC-803693C9D47C}"
Name="Convert Word Document To PDF"
App="ConvertDocToPdf.exe"
From="doc"
To="pdf"
/>
<DocumentConverter Id="{268B3F3F-3043-4179-A34A-50F9CB541757}"
Name="Convert Word Document To PDF"
App="ConvertDocToPdf.exe"
From="docx"
To="pdf"
/>

But it has no effect. Any help is greatly appreciated.

Thanks in advance.

R.Saranya.

Hi

Thanks for your inquiry. Yes of course you can create such converter. I will investigate this issue and provide you more information.

Best regards.

Hi Alexey,

I found a small hint in this issue.In my Elements.xml tags, i made a small change like this

<DocumentConverter Id="{0CCBC151-D68C-4925-ACCC-803693C9D47C}"
Name="Convert Word Document To PDF"
App="ConvertDocToPdf.exe"
From="docx"
To="Pdf"
/>

<DocumentConverter Id="{268B3F3F-3043-4179-A34A-50F9CB541757}"
Name="Convert Word Document To PDF"
App="ConvertDocToPdf.exe"
From="doc"
To="Pdf"
/>

i replaced doc with docx and docx with doc. i deactivated my feature and installed my feature again. This time for .docx files the context menu appears, and the menu was not there for .doc files. I understood from this that whatever conversion type given first inside the , that conversion alone works and the rest is ignored. I don’t know how to handle this or how to combine both the filetypes in a single feature file. I am badly in need of your help to handle this very urgently. i created 2 feature files but that doesn’t work.

Any help s greatly appreciated

Thank you in advance.

R.Saranya.

Hi

Thanks for your inquiry. One definition can’t contain few input formats. Please see the feature definition schema.

http://msdn.microsoft.com/en-us/library/ms497322.aspx

Also think you should have separate exe for each converter you create.

Best regards.

Hi,

I tried to create separate feature for both the Documents and i specified the exe separately as you mentioned. It worked out fine.

Thanks,

Saranya.

Hi!

We are delighted to announce the availability of Aspose.Words for SharePoint, which is our latest addition to the Aspose.Words product family.

This release, Aspose.Words for SharePoint 1.0 makes high quality document conversions for DOC/DOCX/ODT/RTF/PDF/XPS and others easily accessible to SharePoint users.

Please find more details in our Documentation area.