GdPicture.NET.14.API
GdPicture14 Namespace / GdPicturePDF Class / DeleteCustomPDFInformation Method
The name of the custom information key (the custom metadata field) to remove.
Example





DeleteCustomPDFInformation Method (GdPicturePDF)
Removes the pair - the custom information key name and its value - from the custom metadata fields of the currently loaded PDF document according to the specified key name.
Syntax
'Declaration
 
Public Function DeleteCustomPDFInformation( _
   ByVal Key As String _
) As GdPictureStatus
 

Parameters

Key
The name of the custom information key (the custom metadata field) to remove.

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 delete a custom metadata field specified by its key name from the PDF document.
Dim gdpicturePDF As GdPicturePDF = New GdPicturePDF()
Dim status As GdPictureStatus = gdpicturePDF.LoadFromFile("test.pdf", False)
If status = GdPictureStatus.OK Then
    Dim keys As String = gdpicturePDF.GetCustomPDFInformationKeys("~")
    status = gdpicturePDF.GetStat()
    If status = GdPictureStatus.OK Then
        If keys.Equals("") Then
            MessageBox.Show("Your PDF document does not contain any custom keys.", "Example: DeleteCustomPDFInformation")
        Else
            If keys.Contains("gdpicture") Then
                status = gdpicturePDF.DeleteCustomPDFInformation("gdpicture")
                If status = GdPictureStatus.OK Then
                    status = gdpicturePDF.SaveToFile("test_DeleteMetaData.pdf")
                    If status = GdPictureStatus.OK Then
                        MessageBox.Show("The example has been followed successfully and the file has been saved.", "Example: DeleteCustomPDFInformation")
                    Else
                        MessageBox.Show("The example has been followed successfully, but the file can't be saved. Status: " + status.ToString(), "Example: DeleteCustomPDFInformation")
                    End If
                Else
                    MessageBox.Show("The DeleteCustomPDFInformation() method has failed with the status: " + status.ToString(), "Example: DeleteCustomPDFInformation")
                End If
            Else
                MessageBox.Show("Your PDF document does not contain custom key gdpicture.", "Example: DeleteCustomPDFInformation")
            End If
        End If
    Else
        MessageBox.Show("The GetCustomPDFInformationKeys() method has failed with the status: " + status.ToString(), "Example: DeleteCustomPDFInformation")
    End If
Else
    MessageBox.Show("The file can't be loaded.", "Example: DeleteCustomPDFInformation")
End If
gdpicturePDF.Dispose()
See Also