Examples

Create PDF Packages

Combining multiple resources into a single PDF container (PDF package) for easier organization and sharing is a breeze when using DynamicPDF Core Suite for .NET. The following example shows you how.

How to Create PDF Package

The following steps and C# sample code illustrate creating a PDF package using DynamicPDF Core Suite for .NET.


Steps for Creating a PDF Package


  1. Create a Document object.
  2. Create a EmbeddedFile object and point to desired file.
  3. Create a Page object and add it to the Document instance.
  4. Create a DocumentPackage object and set the attachment type.
  5. Associate the DocumentPackage to Document object's package property.
  6. Add all the elements to the Page instance.
  7. Assign a DiskBufferingOptions object to the Document object's DiskBuffering property.
  8. Add the Document object's Draw method to draw and save the PDF document.

Sample Code - C#


Document document = new Document();

EmbeddedFile embeddedFile1 = new EmbeddedFile("myFile1.pdf");
EmbeddedFile embeddedFile2 = new EmbeddedFile("myFile2.pdf");
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("output.pdf");

A PDF package.

GitHub Project

Examples are provided in C# and VB.NET. Clone or view the example project at GitHub. Example code is contained in the following files.


Clone or View Example Project on GitHub

Getting Started

Get started easily by installing DynamicPDF Core Suite for .NET through NuGet or manually. Then, refer to the documentation for more information on using and purchasing the product.


NuGet Package


The easiest way to install DynamicPDF Core Suite is by obtaining the NuGet package using Visual Studio's Package Manager. You can also obtain the NuGet package by downloading it directly. Refer to the installation documentation for more information.

NuGet Package ID: ceTe.DynamicPDF.CoreSuite.NET

DynamicPDF Core Suite Information


DynamicPDF Core Suite for .NET combines creating, merging, and visual report creation into one powerful product for creating PDF documents. It is ideal for anyone who needs to generate PDF documents or reports or work with existing PDFs in their applications. With a free Evaluation Edition to try and with flexible and royalty-free licensing options, why not start using DynamicPDF Core Suite for .NET today!



For more information on Packages

Available on Other Platforms

DynamicPDF Core Suite is also available for the Java and COM/AxtiveX platforms. Refer to the respective product pages for more details.


Why Choose DynamicPDF?

  • Transparent Pricing
  • Lots of Features
  • Easy to Use
  • Great Support
  • Efficient Performance
  • Product Maturity (Over 22 Years)
  • Free Evaluation
  • .NET Core Support (Most Products)
  • Flexible Licensing

We’re Not The Only Ones That Think We’re Great!