GdPicture.NET.14.API
GdPicture14 Namespace / GdPicturePDF Class / PortFolioDelete Method
Example





In This Topic
PortFolioDelete Method (GdPicturePDF)
In This Topic
Removes all information related to a PDF Portfolio from the currently loaded PDF Portfolio document and converts this file to a common PDF document. The collected files are embedded one by one into the source document. You can use the GdPicturePDF.GetEmbeddedFileCount method to check the number of embedded files.
Syntax
'Declaration
 
Public Function PortFolioDelete() As GdPictureStatus
public GdPictureStatus PortFolioDelete()
public function PortFolioDelete(): GdPictureStatus; 
public function PortFolioDelete() : GdPictureStatus;
public: GdPictureStatus PortFolioDelete(); 
public:
GdPictureStatus PortFolioDelete(); 

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 convert your PDF Portfolio document into a common PDF document with embedded files.
Dim caption As String = "Example: PortFolioDelete"
Dim gdpicturePDF As New GdPicturePDF()
If gdpicturePDF.LoadFromFile("gdpicturepdf_portfolio.pdf", False) = GdPictureStatus.OK Then
    Dim status As GdPictureStatus = gdpicturePDF.PortFolioDelete()
    If status = GdPictureStatus.OK Then
        Dim count As Integer = gdpicturePDF.GetEmbeddedFileCount()
        status = gdpicturePDF.GetStat()
        If status = GdPictureStatus.OK Then
            MessageBox.Show("The PDF Portfolio has been successfully deteted." + vbCrLf + "This common PDF document contains " + count.ToString() + " embedded files.", caption)
            gdpicturePDF.SaveToFile("gdpicturepdf_commonpdf.pdf")
        Else
            MessageBox.Show("The PDF Portfolio has been successfully deteted." + vbCrLf + "This error occurs when finding the number of embedded files: " + status.ToString(), caption)
        End If
    Else
        MessageBox.Show("The PortFolioDelete() 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: PortFolioDelete";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
if (gdpicturePDF.LoadFromFile("gdpicturepdf_portfolio.pdf", false) == GdPictureStatus.OK)
{
    GdPictureStatus status = gdpicturePDF.PortFolioDelete();
    if (status == GdPictureStatus.OK)
    {
        int count = gdpicturePDF.GetEmbeddedFileCount();
        status = gdpicturePDF.GetStat();
        if (status == GdPictureStatus.OK)
        {
            MessageBox.Show("The PDF Portfolio has been successfully deteted.\nThis common PDF document contains " + count.ToString() + " embedded files.", caption);
            gdpicturePDF.SaveToFile("gdpicturepdf_commonpdf.pdf");
        }
        else
        {
            MessageBox.Show("The PDF Portfolio has been successfully deteted.\nThis error occurs when finding the number of embedded files: " + status.ToString(), caption);
        }
    }
    else
    {
        MessageBox.Show("The PortFolioDelete() method has failed with the status: " + status.ToString(), caption);
    }
}
else
{
    MessageBox.Show("The file can't be loaded.", caption);
}
gdpicturePDF.Dispose();
See Also