Accusoft.PdfXpress5.Net
Work With Attachments and Portfolio Documents
Send Feedback
PDF Xpress 5 for .NET - User Guide > How To > Work With Attachments and Portfolio Documents

Glossary Item Box

PDF Xpress™ supports working with Attachments and Portfolio Documents.

To determine if a PDF document is a Portfolio, check the IsPortfolio property.

If the document is a Portfolio, if rasterized then what’s rendered is the Portfolio’s Cover Sheet. To access the contents of the portfolio you need to get the Document’s attachments.

The following is an example in which a PDF document is opened, a determination is made as to whether it's a portfolio, and the attachments of the document are accessed. You can then build a UI to show the various properties of the attachments, open the attachment’s data, and modify it.

C# Copy Code
using Accusoft.PdfXpressSdk;
using System.Drawing;
namespace PortfolioAndAttachments
{
    class Program
    {
        static void Main(string[] args)
        {
            using (PdfXpress pdf = new PdfXpress())
            {
                pdf.Initialize();
                using (Document doc = new Document(pdf, "portfolio.pdf"))
                {
                    if (doc.IsPortfolio)
                    {
                        int attachmentCount = doc.GetAttachmentCount();
                        for (int attachmentIndex = 0; attachmentIndex < attachmentCount; attachmentIndex++)
                        {
                            using (PdfDocumentAttachment attachment = doc.GetAttachment(attachmentIndex))
                            {
                                //access the attachment data as you please here...                            
                            }
                        }
                    }
                }
            }
        }
    }
}
©2012. Accusoft Corporation. All Rights Reserved.