Skip to content

Not converting PDF to HTML also file not saved on specified location #8

Description

@cupatil

We are evaluating Android aspose pdf library and trying to convert pdf to html but the file is not generating.

We are using below code for the same:

InputStream i = null;
try {
    i = this.context.getApplicationContext().getContentResolver().openInputStream(uris[0]);
    Document d = new Document(i);
    App.closeStream(i);

    File output = new File(context.getFilesDir(), "html/Aspose_DocToHTML.html");
    d.save(output.toString(), SaveFormat.);

    return output.toString();
} catch (Exception x) {
    this.error = x;
} finally {
    App.closeStream(i);
}

To apply license, Using below code in application class

License license = new License();
InputStream i = null;
try {
    i = getResources().getAssets().open(getString(R.string.aspose_pdf_license_asset_file));
    license.setLicense(i);
    closeStream(i);
} catch (Exception x) {
    Log.e(App.class.getName(), Log.getStackTraceString(x));
} finally {
    closeStream(i);
}

Added below lib in gradle:

compile (
group: 'com.aspose',
name: 'aspose-pdf',
version: '20.11',
classifier: 'android.via.java')

Please suggest, We have did same thing to Aspose word library there it work properly also saving the html file. but here we are not getting any error also not generating/saving html file. We have also cross checked the write external storage permission for the same.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions