Add the Java client to your Maven POM file:
Import the API Client package by adding this line to the top of your .java file:
import com.cloudmersive.client.invoker.ApiClient; import com.cloudmersive.client.invoker.ApiException; import com.cloudmersive.client.invoker.Configuration; import com.cloudmersive.client.invoker.auth.*; import com.cloudmersive.client.ConvertDocumentApi;
Get your API Key (available in your Account Dashboard) and instantiate the API Client object:
ApiClient defaultClient = Configuration.getDefaultApiClient(); ApiKeyAuth Apikey = (ApiKeyAuth) defaultClient.getAuthentication("Apikey"); Apikey.setApiKey("YOUR API KEY");
ConvertDocumentApi apiInstance = new ConvertDocumentApi(); File inputFile = new File("C:\\temp\\input.docx"); // File | Input file to perform the operation on. try { byte[] result = apiInstance.convertDocumentDocxToPdf(inputFile); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ConvertDocumentApi#convertDocumentDocxToPdf"); e.printStackTrace(); }
Add it in your root build.gradle at the end of repositories:
allprojects { repositories { ... maven { url 'https://jitpack.io' } } }
Add the dependency:
dependencies { implementation 'com.github.Cloudmersive:Cloudmersive.APIClient.Java:v3.62' }
Import the API Client package by adding this line to the top of your .java file:
import com.cloudmersive.client.invoker.ApiClient; import com.cloudmersive.client.invoker.ApiException; import com.cloudmersive.client.invoker.Configuration; import com.cloudmersive.client.invoker.auth.*; import com.cloudmersive.client.ConvertDocumentApi;
Get your API Key (available in your Account Dashboard) and instantiate the API Client object:
ApiClient defaultClient = Configuration.getDefaultApiClient(); ApiKeyAuth Apikey = (ApiKeyAuth) defaultClient.getAuthentication("Apikey"); Apikey.setApiKey("YOUR API KEY");
ConvertDocumentApi apiInstance = new ConvertDocumentApi(); File inputFile = new File("C:\\temp\\input.docx"); // File | Input file to perform the operation on. try { byte[] result = apiInstance.convertDocumentDocxToPdf(inputFile); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ConvertDocumentApi#convertDocumentDocxToPdf"); e.printStackTrace(); }
Add the Java client to your Maven POM file:
Import the API Client package by adding this line to the top of your .java file:
import com.cloudmersive.client.rt.invoker.ApiClient; import com.cloudmersive.client.rt.invoker.ApiException; import com.cloudmersive.client.rt.invoker.Configuration; import com.cloudmersive.client.rt.invoker.auth.*; import com.cloudmersive.client.rt.invoker.models.*; import com.cloudmersive.client.rt.ScanApi;
Get your API Key (available in your Account Dashboard) and instantiate the API Client object:
ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.cloudmersive.com"); // Configure API key authorization: Apikey ApiKeyAuth Apikey = (ApiKeyAuth) defaultClient.getAuthentication("Apikey"); Apikey.setApiKey("YOUR API KEY"); ScanApi apiInstance = new ScanApi(defaultClient); File inputFile = new File("/path/to/file"); // File | Input file to perform the operation on. try { VirusScanResult result = apiInstance.scanFile(inputFile); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ScanApi#scanFile"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); }
Add the Java client to your Maven POM file:
Import the API Client package by adding this line to the top of your .java file:
import com.cloudmersive.client.rt.invoker.ApiClient; import com.cloudmersive.client.rt.invoker.ApiException; import com.cloudmersive.client.rt.invoker.Configuration; import com.cloudmersive.client.rt.invoker.auth.*; import com.cloudmersive.client.rt.invoker.models.*; import com.cloudmersive.client.rt.ScanApi;
Get your API Key (available in your Account Dashboard) and instantiate the API Client object:
ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.cloudmersive.com"); // Configure API key authorization: Apikey ApiKeyAuth Apikey = (ApiKeyAuth) defaultClient.getAuthentication("Apikey"); Apikey.setApiKey("YOUR API KEY"); ScanApi apiInstance = new ScanApi(defaultClient); File inputFile = new File("/path/to/file"); // File | Input file to perform the operation on. try { VirusScanResult result = apiInstance.scanFile(inputFile); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ScanApi#scanFile"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); }