Dim caption As String = "Example: SetPrependContentMode"
Dim gdpicturePDF As New GdPicturePDF()
'See the SetBlendMode() method how to create this file.
Dim status As GdPictureStatus = gdpicturePDF.LoadFromFile("test_BlendMode.pdf", False)
If status = GdPictureStatus.OK Then
Dim pageWidth As Single = gdpicturePDF.GetPageWidth()
status = gdpicturePDF.GetStat()
If status <> GdPictureStatus.OK Then
MessageBox.Show("The GetPageWidth() method has failed.", caption)
GoTo [error]
End If
Dim pageHeight As Single = gdpicturePDF.GetPageHeight()
status = gdpicturePDF.GetStat()
If status <> GdPictureStatus.OK Then
MessageBox.Show("The GetPageHeight() method has failed.", caption)
GoTo [error]
End If
'The first page is selected implicitly.
'The current measurement units are set to points and the current origin is bottom left by default.
If (gdpicturePDF.SetPrependContentMode(True) = GdPictureStatus.OK) AndAlso
(gdpicturePDF.AddTransformationMatrix(1, 0, 0, 1, pageWidth / 2, pageHeight / 2) = GdPictureStatus.OK) AndAlso
(gdpicturePDF.AddRotationAt(20, 0, 0) = GdPictureStatus.OK) AndAlso
(gdpicturePDF.AddTransformationMatrix(1, 0, 0, 1, -pageWidth / 2, -pageHeight / 2) = GdPictureStatus.OK) Then
status = gdpicturePDF.SaveToFile("test_PrependMode.pdf")
If status = GdPictureStatus.OK Then
MessageBox.Show("The example has been followed successfully and the file has been saved.", caption)
Else
MessageBox.Show("The example has been followed successfully, but the file can't be saved. Status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The example has not been followed successfully." + vbCrLf + "The last known status is " + gdpicturePDF.GetStat().ToString(), caption)
End If
Else
MessageBox.Show("The LoadFromFile() method has failed with the status: " + status.ToString(), caption)
End If
[error]:
gdpicturePDF.Dispose()
string caption = "Example: SetPrependContentMode";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
//See the SetBlendMode() method how to create this file.
GdPictureStatus status = gdpicturePDF.LoadFromFile("test_BlendMode.pdf", false);
if (status == GdPictureStatus.OK)
{
float pageWidth = gdpicturePDF.GetPageWidth();
status = gdpicturePDF.GetStat();
if (status != GdPictureStatus.OK)
{
MessageBox.Show("The GetPageWidth() method has failed.", caption);
goto error;
}
float pageHeight = gdpicturePDF.GetPageHeight();
status = gdpicturePDF.GetStat();
if (status != GdPictureStatus.OK)
{
MessageBox.Show("The GetPageHeight() method has failed.", caption);
goto error;
}
//The first page is selected implicitly.
//The current measurement units are set to points and the current origin is bottom left by default.
if ((gdpicturePDF.SetPrependContentMode(true) == GdPictureStatus.OK) &&
(gdpicturePDF.AddTransformationMatrix(1, 0, 0, 1, pageWidth / 2, pageHeight / 2) == GdPictureStatus.OK) &&
(gdpicturePDF.AddRotationAt(20, 0, 0) == GdPictureStatus.OK) &&
(gdpicturePDF.AddTransformationMatrix(1, 0, 0, 1, -pageWidth / 2, -pageHeight / 2) == GdPictureStatus.OK))
{
status = gdpicturePDF.SaveToFile("test_PrependMode.pdf");
if (status == GdPictureStatus.OK)
MessageBox.Show("The example has been followed successfully and the file has been saved.", caption);
else
MessageBox.Show("The example has been followed successfully, but the file can't be saved. Status: " + status.ToString(), caption);
}
else
MessageBox.Show("The example has not been followed successfully.\nThe last known status is " + gdpicturePDF.GetStat().ToString(), caption);
}
else
MessageBox.Show("The LoadFromFile() method has failed with the status: " + status.ToString(), caption);
error:
gdpicturePDF.Dispose();