Some test text!
Android / Guides / PDF to MS Office
Platform
Documentation
The PDF to Office conversion API uses easyPDF Cloud REST API and allows conversion from PDF to Office (Word, PowerPoint and Excel).
Integrate Apryse core and the tools library as described here .
In your app module's build.gradle
file (usually app/build.gradle
), add the dependency for Apryse's actions package:
dependencies {
implementation "com.pdftron:actions:9.5.0"
}
Integrate Apryse core and tools packages as described here .
Copy pdftron-actions.aar
directly into your app module's libs
directory. You will see other Apryse AARs here such as pdftron.aar
and tools.aar
In your app module's build.gradle
file (usually app/build.gradle
), add a dependency to Apryse actions package:
dependencies {
implementation "com.pdftron:actions@aar"
implementation "com.squareup.okhttp3:okhttp:3.12.8"
}
First, initialize EasyPdfService
:
// Client ID. You can get your client ID from the developer page
// (for registered user, you must sign in before visiting this page)
// https://www.easypdfcloud.com/developer
//
// To test the sample code quickly for demo purpose, you can use
// the following demo client ID:
//
// 05ee808265f24c66b2b8e31d90c31ab1
//
private final String clientId = "05ee808265f24c66b2b8e31d90c31ab1";
// Client secret. You can get your client secret from the developer page
// (for registered user, you must sign in before visiting this page)
// https://www.easypdfcloud.com/developer
//
// To test the sample code quickly for demo purpose, you can use
// the following demo client secret:
//
// 16ABE87E052059F147BB2A491944BF7EA7876D0F843DED105CBA094C887CBC99
//
private final String clientSecret = "16ABE87E052059F147BB2A491944BF7EA7876D0F843DED105CBA094C887CBC99";
EasyPdfService.initialize(clientId, clientSecret);
Then perform the conversion:
String taskTypeWord = "EPWF_CONVERTER_CONVERT_TO_WORD"
String taskTypePPT = "EPWF_CONVERTER_CONVERT_TO_POWERPOINT"
String taskTypeExcel = "EPWF_CONVERTER_CONVERT_TO_EXCEL"
String taskRevision = 2
private String export(File inputFile, File ouputFolder, String outputName) {
return EasyPdfService.startDynamicJob(
taskTypeWord, // taskTypePPT for PowerPoint and taskTypeExcel for Excel
taskRevision,
inputFile,
ouputFolder,
outputName
);
}
Get the answers you need: Support