GdPicture.NET.14.API
GdPicture14 Namespace / GdPicturePDF Class / RotatePageEx Method
The angle of rotation. This parameter is without any restrictions.
Example





In This Topic
RotatePageEx Method (GdPicturePDF)
In This Topic
Rotates counterclockwise the whole content of the currently selected page in the loaded PDF document through an angle you have specified.
Syntax
'Declaration
 
Public Function RotatePageEx( _
   ByVal Angle As Single _
) As GdPictureStatus
public GdPictureStatus RotatePageEx( 
   float Angle
)
public function RotatePageEx( 
    Angle: Single
): GdPictureStatus; 
public function RotatePageEx( 
   Angle : float
) : GdPictureStatus;
public: GdPictureStatus RotatePageEx( 
   float Angle
) 
public:
GdPictureStatus RotatePageEx( 
   float Angle
) 

Parameters

Angle
The angle of rotation. This parameter is without any restrictions.

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.

We strongly recommend always checking this status first.

Remarks
This method is only allowed for use with non-encrypted documents.

This method requires the Document Editor component to run.

Example
How to rotate the content of the first page counterclockwise by 45 degrees.
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();
See Also