Free Support Forum - aspose.com

Converting word to pdf using Aspose.net from java application

We bought full Aspose SDK with priority support in january 2013. I need urgent help. Can you please share the sample code to use Aspose.net api (any api) from java application? I used Aspose java to convert word to pdf but that got lot of rendering issues. So I want to call reference Aspose.net dlls to convert word doc to pdf. Is there any implications for doing this way? Is there any performance impact ? Will this Aspose.net assemblies work on linux environment?


Please provide this information ASAP.

Viral

Hi Viral,


Thanks for your inquiry. Please accept my apologies for late response.

Please note that Aspose.Words for Java is a class library that enables your applications to perform a great range of document processing tasks. It does not provide any class/methods which can be used to call .NET API. However, you can achieve your requirement by creating a .NET application which converts the document to PDF and call this application from Java. Please see the following code snippet for your kind reference.

C# Code

namespace Word2PDF

{

class Program

{

static void Main(string[] args)

{

Document doc = new Document(args[0]);

doc.Save(args[1]);

}

}

}

Java Code

String filePath = "c:\\Word2PDF.exe c:\\Word2Pdf.docx c:\\Word2Pdf.pdf";

try {

Process p = Runtime.getRuntime().exec(filePath);

} catch (Exception e) {

e.printStackTrace();

}


Hope this helps you. Please read following documentation links for your kind reference.
http://www.aspose.com/docs/display/wordsjava/System+Requirements
http://www.aspose.com/docs/display/wordsjava/Feature+Overview