Excel to PDF Android

In various cases, you may need to share the Excel files over the internet. To avoid tampering, it is a best practice to convert these files to PDF format before sharing. Accordingly, in this article, you will learn how to convert Excel XLSX or XLS files to PDF in Android apps. In addition, customization of Excel to PDF conversion will also be discussed.

Android Excel to PDF Converter Library

To convert Excel spreadsheets to PDF, we’ll use Aspose.Cells for Android via Java. It is a feature-rich Android library that lets you create, modify and convert Excel XLSX/XLS files seamlessly. You can either download the library or install it using the following configurations in build.gradle.

maven {
    url "https://repository.aspose.com/repo/" }
compile (
        group: 'com.aspose',
        name: 'aspose-cells',
        version: '21.3',
        classifier: 'android.via.java')

Convert Excel XLSX or XLS to PDF in Android

The following are the steps to convert an Excel XLSX file to PDF in Android.

The following code sample shows how to convert an XLSX file to PDF in Android.

Android Excel to PDF with Additional Options

You can also control the Excel to PDF conversion to customize the converted PDF as required. For example, you can define the PDF compliance, pages per sheet, gridlines style, a range of sheets to convert, etc. To achieve this, Aspose.Cells provides PdfSaveOptions class. The following are the steps of how to customize the XLSX/XLS to PDF conversion.

The following code sample shows how to customize Excel to PDF conversion in Android.

Get a Free API License

You can request a free temporary license to use the API without evaluation limitations.

Conclusion

In this article, you have learned how to convert Excel XLSX or XLS files to PDF from within the Android apps. Furthermore, you have seen how to customize the Excel to PDF conversion using different options. You can explore more about Aspose.Cells for Android via Java using the documentation. In case you would have any queries, feel free to let us know via our forum.

See Also