[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IShrinkToFitSettings

IShrinkToFitSettings Interface

Represents the shrink to fit settings of this workbook.

Provides settings that control how wrapped text is reduced during PDF export so that the text can fit within the available cell area. Use ShrinkToFitSettings to access this interface and configure whether wrapped text can shrink to fit and the minimum font size to use.

Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public interface IShrinkToFitSettings
Public Interface IShrinkToFitSettings
Examples
worksheet.Range["A1"].Value = "Document Solutions For Excel";
worksheet.Range["A1"].ColumnWidth = 12;
worksheet.Range["A1"].WrapText = true;
worksheet.Range["A1"].ShrinkToFit = true;

PdfSaveOptions options = new PdfSaveOptions();
IShrinkToFitSettings settings = options.ShrinkToFitSettings;
settings.CanShrinkToFitWrappedText = true;
settings.MinimumFont = 10;
string outputPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), $"{Guid.NewGuid():N}.pdf");
try {
    workbook.Save(outputPath, options);
}
finally {
    if (System.IO.File.Exists(outputPath)) {
        System.IO.File.Delete(outputPath);
    }
}

Properties

Name Description
CanShrinkToFitWrappedText

Gets or sets whether wrapped text can shrink to fit.

Returns whether wrapped text is allowed to reduce its font size during PDF export when shrink-to-fit is applied.

Ellipsis

Gets or sets the ellipsis string. The default value is "...".

This string is used when wrapped text is not fully displayed during shrink-to-fit processing. It can be used together with MinimumFont to control how truncated wrapped text is shown.

MinimumFont

Gets or sets the minimum font size used when performing shrink to fit.

This value specifies the smallest font size that can be used when wrapped text is reduced during shrink-to-fit processing.