GdPicture.NET.14
GdPicture14 Namespace / GdPicturePDF Class / FlipPage Method
Set this parameter to true if you want to horizontally flip the content of the current page. Otherwise set it to false.
Set this parameter to true if you want to vertically flip the content of the current page. Otherwise set it to false.
Example





In This Topic
FlipPage Method (GdPicturePDF)
In This Topic
Flips the content of the currently selected page in the loaded PDF document horizontally or vertically according to your preference.
Syntax
'Declaration
 
Public Function FlipPage( _
   ByVal FlipX As Boolean, _
   ByVal FlipY As Boolean _
) As GdPictureStatus
public GdPictureStatus FlipPage( 
   bool FlipX,
   bool FlipY
)
public function FlipPage( 
    FlipX: Boolean;
    FlipY: Boolean
): GdPictureStatus; 
public function FlipPage( 
   FlipX : boolean,
   FlipY : boolean
) : GdPictureStatus;
public: GdPictureStatus FlipPage( 
   bool FlipX,
   bool FlipY
) 
public:
GdPictureStatus FlipPage( 
   bool FlipX,
   bool FlipY
) 

Parameters

FlipX
Set this parameter to true if you want to horizontally flip the content of the current page. Otherwise set it to false.
FlipY
Set this parameter to true if you want to vertically flip the content of the current page. Otherwise set it to false.

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.
Example
How to flip the content of the first page horizontally and vertically. This example shows you all four combinations of the flipping parameters. The flipped pages are subsequently saved into the newly created PDF document.
Dim gdpicturePDF As New GdPicturePDF()
If gdpicturePDF.LoadFromFile("test.pdf", False) = GdPictureStatus.OK Then
    Dim count As Integer = gdpicturePDF.GetPageCount()
    Dim status As GdPictureStatus = gdpicturePDF.GetStat()
    If status = GdPictureStatus.OK Then
        If count > 0 Then
            status = gdpicturePDF.SelectPage(1)
        Else
            status = GdPictureStatus.InvalidParameter
        End If
        If status = GdPictureStatus.OK Then
            Dim oGdPictureNewPDF As New GdPicturePDF()
            status = oGdPictureNewPDF.NewPDF()
            If status = GdPictureStatus.OK Then
                status = gdpicturePDF.FlipPage(True, False)
                If status = GdPictureStatus.OK Then
                    status = oGdPictureNewPDF.ClonePage(gdpicturePDF, 1)
                    If status = GdPictureStatus.OK Then
                        status = gdpicturePDF.FlipPage(False, True)
                        If status = GdPictureStatus.OK Then
                            status = oGdPictureNewPDF.ClonePage(gdpicturePDF, 1)
                            If status = GdPictureStatus.OK Then
                                status = gdpicturePDF.FlipPage(True, True)
                                If status = GdPictureStatus.OK Then
                                    status = oGdPictureNewPDF.ClonePage(gdpicturePDF, 1)
                                    If status = GdPictureStatus.OK Then
                                        status = gdpicturePDF.FlipPage(False, False)
                                        If status = GdPictureStatus.OK Then
                                            status = oGdPictureNewPDF.ClonePage(gdpicturePDF, 1)
                                            If status = GdPictureStatus.OK Then
                                                status = oGdPictureNewPDF.SaveToFile("test_FlipPage.pdf")
                                                If status = GdPictureStatus.OK Then
                                                    MessageBox.Show("The example HAS been followed successfully.", "Example: FlipPage")
                                                End If
                                            End If
                                        End If
                                    End If
                                End If
                            End If
                        End If
                    End If
                End If
            End If
            oGdPictureNewPDF.Dispose()
        End If
    End If
    If status <> GdPictureStatus.OK Then
        MessageBox.Show("The example HAS NOT been followed successfully. The last error status is: " + status.ToString(), "Example: FlipPage")
    End If
Else
    MessageBox.Show("The file can't be loaded.", "Example: FlipPage")
End If
gdpicturePDF.Dispose()
GdPicturePDF gdpicturePDF = new GdPicturePDF();
if (gdpicturePDF.LoadFromFile("test.pdf", false) == GdPictureStatus.OK)
{
    int count = gdpicturePDF.GetPageCount();
    GdPictureStatus status = gdpicturePDF.GetStat();
    if (status == GdPictureStatus.OK)
    {
        if (count > 0)
            status = gdpicturePDF.SelectPage(1);
        else
            status = GdPictureStatus.InvalidParameter;
        if (status == GdPictureStatus.OK)
        {
            GdPicturePDF oGdPictureNewPDF = new GdPicturePDF();
            status = oGdPictureNewPDF.NewPDF();
            if (status == GdPictureStatus.OK)
            {
                status = gdpicturePDF.FlipPage(true, false);
                if (status == GdPictureStatus.OK)
                {
                    status = oGdPictureNewPDF.ClonePage(gdpicturePDF, 1);
                    if (status == GdPictureStatus.OK)
                    {
                        status = gdpicturePDF.FlipPage(false, true);
                        if (status == GdPictureStatus.OK)
                        {
                            status = oGdPictureNewPDF.ClonePage(gdpicturePDF, 1);
                            if (status == GdPictureStatus.OK)
                            {
                                status = gdpicturePDF.FlipPage(true, true);
                                if (status == GdPictureStatus.OK)
                                {
                                    status = oGdPictureNewPDF.ClonePage(gdpicturePDF, 1);
                                    if (status == GdPictureStatus.OK)
                                    {
                                        status = gdpicturePDF.FlipPage(false, false);
                                        if (status == GdPictureStatus.OK)
                                        {
                                            status = oGdPictureNewPDF.ClonePage(gdpicturePDF, 1);
                                            if (status == GdPictureStatus.OK)
                                            {
                                                status = oGdPictureNewPDF.SaveToFile("test_FlipPage.pdf");
                                                if (status == GdPictureStatus.OK)
                                                    MessageBox.Show("The example HAS been followed successfully.", "Example: FlipPage");
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            oGdPictureNewPDF.Dispose();
        }
    }
    if (status != GdPictureStatus.OK)
        MessageBox.Show("The example HAS NOT been followed successfully. The last error status is: " + status.ToString(), "Example: FlipPage");
}
else
    MessageBox.Show("The file can't be loaded.", "Example: FlipPage");
gdpicturePDF.Dispose();
See Also