Package PDF (Portfolio)

A PDF package (Package class) combines multiple files to form a single unit. The files embedded within a PDF package can be a wide range of file types from many applications (including PDFs, images, spreadsheets, and text files). The PDF package also contains a PDF that acts as a cover sheet for the package. The style and order that the embedded files appear can also be specified within the DocumentPackage Class.

Document.Package

The Document class contains a Package property. The Package property's value is a DocumentPackage class.

Properties

Property Description
AscendingOrder Gets or sets a boolean which specifies the ordering in ascending or descending. Default value is true(Ascending order).
OrderBy Gets or sets the listing order by using the specified AttachmentListingOrderBy enum element.
RequiredPdfObjects Gets the number of PDF objects required by the resource.
ResourceType Gets the type of resource. (Inherited from Resource)
Uid Gets the unique ID of the resource. (Inherited from Resource)
ViewList Gets or sets the AttachmentLayout . Default is detailed layout.

The following example demonstrates how to create a DocumentPackage and display the embedded files in detail mode sorted in descending order by name.

Document document = new Document();
EmbeddedFile embeddedFile1 = new EmbeddedFile(pdfFilePath);
EmbeddedFile embeddedFile2 = new EmbeddedFile(pdfFilePath);
document.EmbeddedFiles.Add( embeddedFile1 );
document.EmbeddedFiles.Add( embeddedFile2 );
Page page = new Page();
document.Pages.Add( page );
document.Package = new DocumentPackage(AttachmentLayout.Detailed);
document.Package.OrderBy = AttachmentListingOrderBy.Name;
document.Package.AscendingOrder = false;
page.Elements.Add( new Label("Cover Page”, 0, 0, 512, 40, Font.Helvetica, 30, TextAlign.Center ) );
document.Draw(pdfFilePath);        
Dim MyDocument As Document = New Document()
Dim MyEmbeddedFile1 As EmbeddedFile = New EmbeddedFile(pdfFilePath)
Dim MyEmbeddedFile2 As EmbeddedFile = New EmbeddedFile(pdfFilePath)
MyDocument.EmbeddedFiles.Add( MyEmbeddedFile1 )
MyDocument.EmbeddedFiles.Add( MyEmbeddedFile2 )
Dim MyPage As Page = New Page()
MyDocument.Pages.Add( MyPage )
MyDocument.Package = New DocumentPackage(AttachmentLayout.Detailed)
MyDocument.Package.OrderBy = AttachmentListingOrderBy.Name
MyDocument.Package.AscendingOrder = False
MyPage.Elements.Add( New Label("Cover Page”, 0, 0, 512, 40, Font.Helvetica, 30, TextAlign.Center ) )
MyDocument.Draw(pdfFilePath)

Refer to the DocumentPackage API documentation for a complete example.

In this topic