SpreadsheetMaximumPageWidth Property (GdPictureDocumentConverter)
In This Topic
Specifies the maximum page width in millimeters.
A value of zero or less indicates no width limitation.
Syntax
'Declaration
Public Property SpreadsheetMaximumPageWidth As Single
public float SpreadsheetMaximumPageWidth {get; set;}
public read-write property SpreadsheetMaximumPageWidth: Single;
public function get,set SpreadsheetMaximumPageWidth : float
public: __property float get_SpreadsheetMaximumPageWidth();
public: __property void set_SpreadsheetMaximumPageWidth(
float value
);
public:
property float SpreadsheetMaximumPageWidth {
float get();
void set ( float value);
}
Property Value
The default value is 1800.
Example
Loading and converting a .xlsx with SpreadsheetMaximumPageWidth and SpreadsheetMaximumPageHeight set to 3000.
Using gdpictureDocumentConverter As New GdPictureDocumentConverter()
gdpictureDocumentConverter.SpreadsheetMaximumPageWidth = 3000
gdpictureDocumentConverter.SpreadsheetMaximumPageHeight = 3000
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.SpreadsheetMaximumPageWidth = 3000;
gdpictureDocumentConverter.SpreadsheetMaximumPageHeight = 3000;
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 SpreadsheetMaximumPageWidth and SpreadsheetMaximumPageHeight set to 3000.
Using gdpictureDocumentConverter As New GdPictureDocumentConverter()
gdpictureDocumentConverter.SpreadsheetMaximumPageWidth = 3000
gdpictureDocumentConverter.SpreadsheetMaximumPageHeight = 3000
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.SpreadsheetMaximumPageWidth = 3000;
gdpictureDocumentConverter.SpreadsheetMaximumPageHeight = 3000;
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