Skip to main content
Skip table of contents

pdfOffice: Spreadsheet To PDF Support

Since the first release of pdfOffice, we have received a growing number of customer requests to support conversion of .xlsx and .xls spreadsheets to PDF along with the other Office document formats pdfOffice supports.  We have been working hard to include spreadsheet support with the quality and accuracy our customers would expect, and with the release of pdfOffice 2.0.1 we are pleased to announce this has now been implemented.

We have provided iText users a simple way to convert spreadsheet files to PDF by simply calling the OfficeConverter#convertOfficeSpreadsheetToPdf method. This method will convert your Office spreadsheet into a PDF file.

We have also added additional functionality by providing users a property class named OfficeSpreadsheetConverterProperties to configure conversions with user defined properties.

An example of converting a spreadsheet in .xls format to PDF can be found below:

JAVA

JAVA
import com.itextpdf.pdfoffice.OfficeConverter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.File;
import java.io.IOException;

public class Office {


    public static void main(String[] args) throws IOException {

        LicenseKey.loadLicenseFile(new File("license.json"));

        OfficeConverter.convertOfficeSpreadsheetToPdf(new FileInputStream("sample.xls"), 
              new FileOutputStream("output.pdf"));
   }
}




#7_2_1_example #pdfoffice #conversion

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.