Package PDF (Portfolio)

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

The following example demonstrates how to create a DocumentPackage, 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)

In this topic