Set this parameter to true, if you want to enable the prepend mode, otherwise set it to false to disable it. Initial value is false.
Example





In This Topic
GdPicture14 Namespace / GdPicturePDF Class / SetPrependContentMode Method

SetPrependContentMode Method (GdPicturePDF)

In This Topic
Determines if all subsequent modifications of the current page of the loaded PDF document are prepend or append. The initial value is set to false, means the prepend mode is disabled.

This method can be particularly useful if you need to append content on the background of the page, for example drawing an image behind existing text.

Syntax
'Declaration

 

Public Function SetPrependContentMode( _

   ByVal Enable As Boolean _

) As GdPictureStatus
public GdPictureStatus SetPrependContentMode( 

   bool Enable

)
public function SetPrependContentMode( 

    Enable: Boolean

): GdPictureStatus; 
public function SetPrependContentMode( 

   Enable : boolean

) : GdPictureStatus;
public: GdPictureStatus SetPrependContentMode( 

   bool Enable

) 
public:

GdPictureStatus SetPrependContentMode( 

   bool Enable

) 

Parameters

Enable
Set this parameter to true, if you want to enable the prepend mode, otherwise set it to false to disable it. Initial value is 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 rotate the first page of an existing PDF document by an angle of 20 degrees without altering the page's content.
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();
See Also