Dim caption As String = "Example: GetPageHeight"
Dim gdpicturePDF As New GdPicturePDF()
If gdpicturePDF.NewPDF() = GdPictureStatus.OK Then
Dim status As GdPictureStatus = gdpicturePDF.NewPage(PdfPageSizes.PdfPageSizeA4) 'A4 = (210mm x 270mm)
If status = GdPictureStatus.OK Then
gdpicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft)
gdpicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitMillimeter)
Dim height As Single = gdpicturePDF.GetPageHeight()
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
MessageBox.Show("The height of the current page is " + height.ToString() + " mm.", caption)
Else
MessageBox.Show("The GetPageHeight() method has failed with the status: " + status.ToString(), caption)
End If
status = gdpicturePDF.RotatePage(90)
If status = GdPictureStatus.OK Then
height = gdpicturePDF.GetPageHeight()
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
MessageBox.Show("The height of the current page after the rotation is " + height.ToString() + " mm.", caption)
Else
MessageBox.Show("The GetPageHeight() method has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The RotatePage() method has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The NewPage() method has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The file can't be created.", caption)
End If
gdpicturePDF.Dispose()
string caption = "Example: GetPageHeight";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
if (gdpicturePDF.NewPDF() == GdPictureStatus.OK)
{
GdPictureStatus status = gdpicturePDF.NewPage(PdfPageSizes.PdfPageSizeA4); //A4 = (210mm x 270mm)
if (status == GdPictureStatus.OK)
{
gdpicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft);
gdpicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitMillimeter);
float height = gdpicturePDF.GetPageHeight();
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
MessageBox.Show("The height of the current page is " + height.ToString() + " mm." , caption);
else
MessageBox.Show("The GetPageHeight() method has failed with the status: " + status.ToString(), caption);
status = gdpicturePDF.RotatePage(90);
if (status == GdPictureStatus.OK)
{
height = gdpicturePDF.GetPageHeight();
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
MessageBox.Show("The height of the current page after the rotation is " + height.ToString() + " mm.", caption);
else
MessageBox.Show("The GetPageHeight() method has failed with the status: " + status.ToString(), caption);
}
else
MessageBox.Show("The RotatePage() method has failed with the status: " + status.ToString(), caption);
}
else
MessageBox.Show("The NewPage() method has failed with the status: " + status.ToString(), caption);
}
else
MessageBox.Show("The file can't be created.", caption);
gdpicturePDF.Dispose();