Some test text!
The PDF to WORD conversion API uses easyPDF Cloud REST API and allows conversion from PDF to WORD and PDF to HTML.
In your app module's build.gradle
file (usually app/build.gradle
), add the dependency for PDFTron's actions package:
dependencies {
implementation "com.pdftron:actions:8.1.1"
}
pdftron-actions.aar
directly into your app module's libs
directory. You will see other PDFTron 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 PDFTron actions package:
dependencies {
implementation "com.pdftron:collab@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:
//
// 1eb210be402844c287b4464026eb89cb
//
private final String clientId = "1eb210be402844c287b4464026eb89cb";
// 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:
//
// 335F8FC64EC58B460E1420B1EE6B253DEB81EAA09936DEAFF3B14350B5EC8558
//
private final String clientSecret = "335F8FC64EC58B460E1420B1EE6B253DEB81EAA09936DEAFF3B14350B5EC8558";
// Workflow ID. You can get your workflow 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 workflow ID:
//
// 0000000000000001 : "Convert PDF to Word" workflow
//
private final String workflowId = "0000000000000001";
EasyPdfService.initialize(clientId, clientSecret);
EasyPdfService.setJobId(EasyPdfService.Type.PDF_TO_WORD, workflowId);
Then perform the conversion:
private CompositeDisposable mDisposables = new CompositeDisposable();
private void export(File inputFile, File ouputFolder) {
mDisposables.add(EasyPdfService.startPdf2WordJob(inputFile, ouputFolder)
.subscribe(s -> {
// do something with the converted file
}, throwable -> {
// handle error
}));
}
Get the answers you need: Support
Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.
Select a platform to get started with your free trial.
Web
Android
iOS
Windows
Linux
Unlimited usage. No email address required.