ImportedPageContents
Represents the contents used by an the ImportedPageData class.
public class ImportedPageContents : Resource
Public Class ImportedPageContents
Inherits Resource
Inheritance: ObjectResourceImportedPageContents
Licensing Info
This class 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.
Examples
This example shows you how to import one page of an existing PDF using this class.Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.Merger
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
' Create a Page and add it to the document
Dim MyPage As Page = New Page
MyDocument.Pages.Add(MyPage)
' Create an ImportedPageContents object
Dim MyContents As ImportedPageContents = New ImportedPageContents( "C:\ImportPDF.pdf", 2 )
' Create an ImportedPage and add it to the document
Dim MyData As ImportedPageData = New ImportedPageData(MyContents, -200, -100, 0.24F )
MyPage.Elements.Add(MyData)
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.Merger;
public class Example
{
public static void CreatePDF(string outputPath, string inputFilePath)
{
// Create a PDF Document
Document document = new Document();
// Create a Page and add it to the document
Page page = new Page();
document.Pages.Add(page);
// Create an ImportedPageContents object
ImportedPageContents contents = new ImportedPageContents(inputFilePath, 2);
// Create an ImportedPageData and add it to the page
ImportedPageData data = new ImportedPageData(contents, -200, -100, 0.24f);
page.Elements.Add(data);
// Save the document
document.Draw(outputPath);
}
}
Remarks
This class can be used to reuse a pages contents in multiple ImportedPageData objects. Doing so will reduce the size of the output PDF because the contents will only appears in the output document once.
Constructors
ImportedPageContents(Byte[], Int32, [Optional] PageBoundary) | Initializes a new instance of the ImportedPageContents class. |
ImportedPageContents(PdfPage) | Initializes a new instance of the ImportedPageContents class. |
ImportedPageContents(PdfPage, PageBoundary) | Initializes a new instance of the ImportedPageContents class. |
ImportedPageContents(String, Int32) | Initializes a new instance of the ImportedPageContents class. |
ImportedPageContents(String, Int32, PageBoundary) | Initializes a new instance of the ImportedPageContents class. |
Properties
ClipBottom | Gets or sets the bottom clipping of the contents. |
ClipLeft | Gets or sets the left clipping of the contents. |
ClipRight | Gets or sets the right clipping of the contents. |
ClipTop | Gets or sets the top clipping of the contents. |
Height | Gets the clipped height of the contents. |
RequiredPdfObjects | Gets the number of PDF objects required by the imported page data's contents. |
ResourceType | Gets the type of resource. |
Uid | Gets the unique ID of the resource. (Inherited from Resource) |
Width | Gets the clipped width of the contents. |
Methods
Draw(DocumentWriter) | Draws the contents the given DocumentWriter object. |
Equals(Object) | Determines whether the specified Object is equal to the current Object . (Inherited from Object) |
GetHashCode() | Serves as a hash function for a particular type. (Inherited from Object) |
GetType() | Gets the Type of the current instance. (Inherited from Object) |
SetBoundaries(PageBoundary) | Sets the boundaries of the page to the specified boundary on the imported page. |
ToString() | Returns a String that represents the current Object . (Inherited from Object) |