Excel to PDF Linux

PDF is a popular file format which is widely used to share or print documents. In various cases, the documents of other file formats, such as spreadsheets, are converted to PDF. In this article, you are going to learn how to convert Excel files to PDF programmatically on the Linux platform. We will perform this conversion using a .NET spreadsheet manipulation API named Aspose.Cells for .NET.

.NET Excel to PDF Converter API for Linux

Aspose.Cells for .NET is a powerful and widely used class library that offers a range of spreadsheet manipulation features. Using the API, you can create, manipulate, and convert Excel files. Before we begin the demonstration of how to convert Excel files to PDF, you need to set up the .NET environment on Linux, which can be done within a few minutes. The following are the prerequisites that you would need to prepare the environment.

Learn how to create a console application on Linux using Visual Studio Code.

Once you have completed setting up the environment, you can proceed to install Aspose.Cells for .NET in your application. For this, you can use the NuGet Package Manager extension for Visual Studio Code and install the API via NuGet.

Convert an Excel File to PDF on Linux

The following are the steps to convert an Excel XLSX/XLS file to PDF on Linux using Aspose.Cells for .NET.

  1. Create an instance of Workbook class and initialize it with the Excel file’s path.
  2. Convert Excel to PDF using Workbook.Save(string, SaveFormat) method.

The following code sample shows how to convert an Excel file to PDF.

Customize Excel to PDF Conversion

You can also set the additional options to customize the Excel to PDF conversion. For example, you can set the compliance level of the converted PDF document. The following are the steps to define additional options in Excel to PDF conversion on Linux.

  1. Create an instance of Workbook class and initialize it with the Excel file’s path.
  2. Create an instance of PdfSaveOptions class and set options such as PdfSaveOptions.Compliance.
  3. Convert Excel to PDF using Workbook.Save(string, PdfSaveOptions) method.

The following code sample shows how to set PDF compliance in Excel to PDF conversion.

Get a Free License

You can get a temporary license and use Aspose.Cells for .NET without evaluation limitations.

Conclusion

In this article, you have learned how to convert Excel files to PDF on Linux. Moreover, you have seen how to set additional options in Excel to PDF conversion. Besides, you can explore more about Aspose.Cells for .NET using the documentation. Also, you can ask your questions via our forum.

See Also