Dim caption As String = "Example: RotatePageEx"
Dim gdpicturePDF As New GdPicturePDF()
If gdpicturePDF.LoadFromFile("test.pdf", False) = GdPictureStatus.OK Then
Dim status As GdPictureStatus = gdpicturePDF.SelectPage(1)
If status = GdPictureStatus.OK Then
status = gdpicturePDF.RotatePageEx(45)
If status = GdPictureStatus.OK Then
Dim message As String = "The page has been rotated successfully"
If gdpicturePDF.SaveToFile("test_RotatePageEx.pdf") = GdPictureStatus.OK Then
message = message + " and the file has been saved."
Else
message = message + ", but the file can't be saved."
End If
MessageBox.Show(message, caption)
Else
MessageBox.Show("The RotatePageEx() method has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The SelectPage() method has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The file can't be loaded.", caption)
End If
gdpicturePDF.Dispose()
string caption = "Example: RotatePageEx";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
if (gdpicturePDF.LoadFromFile("test.pdf", false) == GdPictureStatus.OK)
{
GdPictureStatus status = gdpicturePDF.SelectPage(1);
if (status == GdPictureStatus.OK)
{
status = gdpicturePDF.RotatePageEx(45);
if (status == GdPictureStatus.OK)
{
string message = "The page has been rotated successfully";
if (gdpicturePDF.SaveToFile("test_RotatePageEx.pdf") == GdPictureStatus.OK)
message = message + " and the file has been saved.";
else
message = message + ", but the file can't be saved.";
MessageBox.Show(message, caption);
}
else
MessageBox.Show("The RotatePageEx() method has failed with the status: " + status.ToString(), caption);
}
else
MessageBox.Show("The SelectPage() method has failed with the status: " + status.ToString(), caption);
}
else
MessageBox.Show("The file can't be loaded.", caption);
gdpicturePDF.Dispose();