Document Solutions for Excel, Java Edition | Document Solutions
File Operations / Export to PDF / Export Fills
In This Topic
    Export Fills
    In This Topic

    DsExcel Java allows users to save worksheets possessing cells with different fill styles.

    In order to export an excel file with fills to PDF format, refer to the following example code.

    Java
    Copy Code
    // Create a new workbook and access the default worksheet
    Workbook workbook = new Workbook();
    IWorksheet worksheet = workbook.getWorksheets().get(0);
            
    // Merge cells and apply fill style
    worksheet.getRange("A1:C2").merge();
    worksheet.getRange("A1:C2").getInterior().setColor(Color.GetGreen());
    
    // Save to a pdf file
    workbook.save("ExportFills.pdf", SaveFileFormat.Pdf);