Skip to end of metadata
Go to start of metadata
Contents Summary

Possible Usage Scenarios

When cell contains text or string but it is larger than the width of the cell, then the string overflows if the next cell in next column is null or empty. When you save your Excel file into PDF/Image, you can control this overflow by specifying the cross type using the TextCrossType enumeration. It has the following values

  • TextCrossType.Default

Display like MS Excel, depends on the next cell. If the next cell is null, the string will cross or it will be truncated.

  • TextCrossType.CrossKeep

Display the string like MS Excel exporting PDF/Image

  • TextCrossType.CrossOverride

Display all the text by crossing other cells and override text of crossed cells

  • TextCrossType.StrictInCell

Only displaying the string within the width of cell.

Specify how to cross string in output PDF/Image using TextCrossType

The following sample code loads the  sample Excel file and saves it to PDF/Image format by specifying different TextCrossType. The sample Excel file and output files can be downloaded from the following links:




Sample Code

// Load the template file
Workbook wb = new Workbook(srcDir + "sampleCrosssType.xlsx");
// Initialize PDF save options
PdfSaveOptions saveOptions = new PdfSaveOptions();
// Set text criss type
// Save output PDF file + "outputCrosssType.pdf", saveOptions);
  • No labels