Dim caption As String = "Example: GetPageWidth"
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 width As Single = gdpicturePDF.GetPageWidth()
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
MessageBox.Show("The width of the current page is " + width.ToString() + " mm.", caption)
Else
MessageBox.Show("The GetPageWidth() method has failed with the status: " + status.ToString(), caption)
End If
status = gdpicturePDF.RotatePage(90)
If status = GdPictureStatus.OK Then
width = gdpicturePDF.GetPageWidth()
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
MessageBox.Show("The width of the current page after the rotation is " + width.ToString() + " mm.", caption)
Else
MessageBox.Show("The GetPageWidth() 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: GetPageWidth";
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 width = gdpicturePDF.GetPageWidth();
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
MessageBox.Show("The width of the current page is " + width.ToString() + " mm." , caption);
else
MessageBox.Show("The GetPageWidth() method has failed with the status: " + status.ToString(), caption);
status = gdpicturePDF.RotatePage(90);
if (status == GdPictureStatus.OK)
{
width = gdpicturePDF.GetPageWidth();
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
MessageBox.Show("The width of the current page after the rotation is " + width.ToString() + " mm.", caption);
else
MessageBox.Show("The GetPageWidth() 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();