SpreadsheetMaximumContentHeightPerSheet Property (GdPictureDocumentConverter)
In This Topic
Decimal value indicating the maximum height of the sheet content, in millimeters. Maximum content height ignores header and footer height.
When multiple pages are required to render a sheet, the content height will be the sum of the content height of each page.
If set to zero or less, no limitation will be applied.
Syntax
'Declaration
Public Property SpreadsheetMaximumContentHeightPerSheet As Single
public float SpreadsheetMaximumContentHeightPerSheet {get; set;}
public read-write property SpreadsheetMaximumContentHeightPerSheet: Single;
public function get,set SpreadsheetMaximumContentHeightPerSheet : float
public: __property float get_SpreadsheetMaximumContentHeightPerSheet();
public: __property void set_SpreadsheetMaximumContentHeightPerSheet(
float value
);
public:
property float SpreadsheetMaximumContentHeightPerSheet {
float get();
void set ( float value);
}
Property Value
The default value is 0 (no limitation).
Example
Loading and converting a .xlsx with SpreadsheetMaximumContentWidthPerSheet and SpreadsheetMaximumContentHeightPerSheet set to 7000.
Using gdpictureDocumentConverter As New GdPictureDocumentConverter()
gdpictureDocumentConverter.SpreadsheetMaximumContentWidthPerSheet = 7000
gdpictureDocumentConverter.SpreadsheetMaximumContentHeightPerSheet = 7000
Dim status As GdPictureStatus = gdpictureDocumentConverter.LoadFromFile("test_xlsx.xlsx", GdPicture14.DocumentFormat.DocumentFormatXLSX)
If status = GdPictureStatus.OK Then
MessageBox.Show("The file has been loaded successfully.", "GdPicture")
status = gdpictureDocumentConverter.SaveAsPDF("Converted.pdf", PdfConformance.PDF)
If status = GdPictureStatus.OK Then
MessageBox.Show("The file has been saved successfully.", "GdPicture")
Else
MessageBox.Show("Failed to save file. Status: " + status.ToString(), "GdPicture")
End If
Else
MessageBox.Show("Failed to load file. Status: " + status.ToString(), "GdPicture")
End If
End Using
using (GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter())
{
gdpictureDocumentConverter.SpreadsheetMaximumContentWidthPerSheet = 7000;
gdpictureDocumentConverter.SpreadsheetMaximumContentHeightPerSheet = 7000;
GdPictureStatus status = gdpictureDocumentConverter.LoadFromFile("test_xlsx.xlsx", GdPicture14.DocumentFormat.DocumentFormatXLSX);
if (status == GdPictureStatus.OK)
{
MessageBox.Show("The file has been loaded successfully.", "GdPicture");
status = gdpictureDocumentConverter.SaveAsPDF("Converted.pdf", PdfConformance.PDF);
if (status == GdPictureStatus.OK)
{
MessageBox.Show("The file has been saved successfully.", "GdPicture");
}
else
{
MessageBox.Show("Failed to save file. Status: " + status.ToString(), "GdPicture");
}
}
else
{
MessageBox.Show("Failed to load file. Status: " + status.ToString(), "GdPicture");
}
}
Example
Loading and converting a .xlsx with SpreadsheetMaximumContentWidthPerSheet and SpreadsheetMaximumContentHeightPerSheet set to 7000.
Using gdpictureDocumentConverter As New GdPictureDocumentConverter()
gdpictureDocumentConverter.SpreadsheetMaximumContentWidthPerSheet = 7000
gdpictureDocumentConverter.SpreadsheetMaximumContentHeightPerSheet = 7000
Dim status As GdPictureStatus = gdpictureDocumentConverter.LoadFromFile("test_xlsx.xlsx", GdPicture14.DocumentFormat.DocumentFormatXLSX)
If status = GdPictureStatus.OK Then
MessageBox.Show("The file has been loaded successfully.", "GdPicture")
status = gdpictureDocumentConverter.SaveAsPDF("Converted.pdf", PdfConformance.PDF)
If status = GdPictureStatus.OK Then
MessageBox.Show("The file has been saved successfully.", "GdPicture")
Else
MessageBox.Show("Failed to save file. Status: " + status.ToString(), "GdPicture")
End If
Else
MessageBox.Show("Failed to load file. Status: " + status.ToString(), "GdPicture")
End If
End Using
using (GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter())
{
gdpictureDocumentConverter.SpreadsheetMaximumContentWidthPerSheet = 7000;
gdpictureDocumentConverter.SpreadsheetMaximumContentHeightPerSheet = 7000;
GdPictureStatus status = gdpictureDocumentConverter.LoadFromFile("test_xlsx.xlsx", GdPicture14.DocumentFormat.DocumentFormatXLSX);
if (status == GdPictureStatus.OK)
{
MessageBox.Show("The file has been loaded successfully.", "GdPicture");
status = gdpictureDocumentConverter.SaveAsPDF("Converted.pdf", PdfConformance.PDF);
if (status == GdPictureStatus.OK)
{
MessageBox.Show("The file has been saved successfully.", "GdPicture");
}
else
{
MessageBox.Show("Failed to save file. Status: " + status.ToString(), "GdPicture");
}
}
else
{
MessageBox.Show("Failed to load file. Status: " + status.ToString(), "GdPicture");
}
}
See Also