cete.dynamicpdf.merger.attachment
Attachment
- Namespace: ceTe.DynamicPDF.Merger
- Assemblies: DynamicPDF.CoreSuite.dll
Represents a Attachments present in PDFDocument
public class Attachment
Public Class Attachment
Inheritance: Object → Attachment
Licensing Info
This class is a DynamicPDF Core Suite Essentials feature. One of the following is required for non-evaluation usage:
- Any active DynamicPDF Subscription (Essentials, Professional, Professional Plus or Ultimate).
- A DynamicPDF Core Suite for .NET v12.X Essentials license.
- It can also be used for free with a public link back to www.dynamicpdf.com and with the DynamicPDF Essentials message displaying on the bottom of each page.
Examples
The following examples retrieves the attachment files in the PDFDocument.
Imports System
Imports System.IO;
Imports System.Collections.Generic;
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.Merger
Module MyModule
Sub Main()
' Create PDF document object
Dim pdfA As PdfDocument = New PdfDocument("C:\ImportPDF.pdf")
' Merge the PDF document
Dim MyDocument As MergeDocument = New MergeDocument(pdfA)
' Getting the AttachmentFiles present in PDFDocument
Dim attachments As Attachment() = pdfA.Attachments()
' Looping through the files to get Attachment Files present
For Each file As ceTe.DynamicPDF.Merger.Attachment In attachments
Dim file1 As Byte() = file.GetData()
File.WriteAllBytes(file.Filename, file1)
Next
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using System.IO;
using System.Collections.Generic;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.Merger;
public class Example
{
public static void CreatePDF(string outputPath, string inputFilePath)
{
// Create PDF document object
PdfDocument pdfA = new PdfDocument(inputFilePath);
// Merge the PDF document
MergeDocument mergeDocument = new MergeDocument(pdfA);
// Getting the AttachmentFiles present in PDFDocument
Attachment[] attachments = pdfA.Attachments();
// Looping through the files to get Attachment Files present
foreach (Attachment file in attachments)
{
byte[] file1 = file.GetData();
File.WriteAllBytes(file.Filename, file1);
}
// Save the PDF
mergeDocument.Draw(outputPath);
}
}
Remarks
This class should be used when you want to get the attachment files present in an pdf document
Properties
Filename
Gets the Filenames of the Attachment Files present in PDFDocument.
public string Filename { get; set; }
Public Property Filename As String
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
MimeType
Gets the Filenames of the Attachment Files present in PDFDocument.
public string MimeType { get; }
Public Property MimeType As String
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Methods
Equals(Object)
Determines whether the specified Object is equal to the current Object . (Inherited from Object)
public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean
Parameters
- obj: Object
The Object to compare with the current Object .
Returns
true if the specified Object is equal to the current Object ; otherwise, false.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
GetData()
Gets the Data of the Attachment Files.
public Byte[] GetData()
Function GetData() As Byte()
Returns
Contains the byte array of Attachment files
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
GetHashCode()
Serves as a hash function for a particular type. (Inherited from Object)
public int GetHashCode()
Function GetHashCode() As Integer
Returns
A hash code for the current Object .
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
GetType()
Gets the Type of the current instance. (Inherited from Object)
public Type GetType()
Function GetType() As Type
Returns
The Type instance that represents the exact runtime type of the current instance.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
ToString()
Returns a String that represents the current Object . (Inherited from Object)
public string ToString()
Function ToString() As String
Returns
A String that represents the current Object .
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.