Dim caption As String = "Example: SetPageUserUnit"
Dim gdpicturePDF As GdPicturePDF = New GdPicturePDF()
If gdpicturePDF.NewPDF() = GdPictureStatus.OK Then
gdpicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitPoint)
'The height and the width for the new page in PDF points.
Dim pageDim As Single = 14400
'Be sure you have selected the proper page.
If (gdpicturePDF.NewPage(pageDim, pageDim) = GdPictureStatus.OK) AndAlso
(gdpicturePDF.SelectPage(1) = GdPictureStatus.OK) Then
'To create a page of size 200 * 200 inches.
Dim userUnit As Single = 75000
gdpicturePDF.SetPageUserUnit(userUnit)
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
gdpicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitInch)
pageDim = gdpicturePDF.GetPageHeight()
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
MessageBox.Show("The current page height and width is " + pageDim + " inches.", caption)
Else
MessageBox.Show("The GetPageHeight() failed with the status: " + gdpicturePDF.GetStat().ToString(), caption)
End If
Else
MessageBox.Show("The SetPageUserUnit() failed with the status: " + gdpicturePDF.GetStat().ToString(), caption)
End If
Else
MessageBox.Show("The new page can't be created. Status: " + gdpicturePDF.GetStat().ToString(), caption)
End If
Else
MessageBox.Show("The new file can't be created. Status: " + gdpicturePDF.GetStat().ToString(), caption)
End If
gdpicturePDF.Dispose()
string caption = "Example: SetPageUserUnit";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
if (gdpicturePDF.NewPDF() == GdPictureStatus.OK)
{
gdpicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitPoint);
float pageDim = 14400; //The height and the width for the new page in PDF points.
//Be sure you have selected the proper page.
if ((gdpicturePDF.NewPage(pageDim, pageDim) == GdPictureStatus.OK) &&
(gdpicturePDF.SelectPage(1) == GdPictureStatus.OK))
{
float userUnit = 75000; //To create a page of size 200 * 200 inches.
gdpicturePDF.SetPageUserUnit(userUnit);
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
gdpicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitInch);
pageDim = gdpicturePDF.GetPageHeight();
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
MessageBox.Show("The current page height and width is " + pageDim + " inches.", caption);
else
MessageBox.Show("The GetPageHeight() failed with the status: " + gdpicturePDF.GetStat().ToString(), caption);
}
else
MessageBox.Show("The SetPageUserUnit() failed with the status: " + gdpicturePDF.GetStat().ToString(), caption);
}
else
MessageBox.Show("The new page can't be created. Status: " + gdpicturePDF.GetStat().ToString(), caption);
}
else
MessageBox.Show("The new file can't be created. Status: " + gdpicturePDF.GetStat().ToString(), caption);
gdpicturePDF.Dispose();