Skip to main content

ImportedPageContents

Version: 12.0

cete.dynamicpdf.merger.importedpagecontents

ImportedPageContents​

Represents the contents used by an the ImportedPageData class.

public class ImportedPageContents : Resource
Public Class ImportedPageContents
Inherits Resource

Inheritance: Object → Resource → ImportedPageContents

Licensing Info​

This class is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

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.

public ImportedPageContents(Byte[] pdfData, int pageNumber, [PageBoundary pageBoundary = CropBox])
Public Sub New (pdfData As Byte(), pageNumber As Integer, Optional pageBoundary As PageBoundary = CropBox)

Parameters​

Byte array of the PDF document to import.

Page number to import.

The boundaries box to use as the edges of the page.

Licensing Info​

This constructor is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

ImportedPageContents(PdfPage)​

Initializes a new instance of the ImportedPageContents class.

public ImportedPageContents(PdfPage pdfPage)
Public Sub New (pdfPage As PdfPage)

Parameters​

PdfPage object to import.

Licensing Info​

This constructor is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

ImportedPageContents(PdfPage, PageBoundary)​

Initializes a new instance of the ImportedPageContents class.

public ImportedPageContents(PdfPage pdfPage, PageBoundary pageBoundary)
Public Sub New (pdfPage As PdfPage, pageBoundary As PageBoundary)

Parameters​

PdfPage object to import.

The boundaries box to use as the edges of the page.

Licensing Info​

This constructor is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

ImportedPageContents(String, Int32)​

Initializes a new instance of the ImportedPageContents class.

public ImportedPageContents(string filePath, int pageNumber)
Public Sub New (filePath As String, pageNumber As Integer)

Parameters​

Physical file path of the PDF document to import.

Page number to import.

Licensing Info​

This constructor is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

ImportedPageContents(String, Int32, PageBoundary)​

Initializes a new instance of the ImportedPageContents class.

public ImportedPageContents(string filePath, int pageNumber, PageBoundary pageBoundary)
Public Sub New (filePath As String, pageNumber As Integer, pageBoundary As PageBoundary)

Parameters​

Physical file path of the PDF document to import.

Page number to import.

The boundaries box to use as the edges of the page.

Licensing Info​

This constructor is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Properties​

ClipBottom​

Gets or sets the bottom clipping of the contents.

public float ClipBottom { get; set; }
Public Property ClipBottom As Single

Property Value​

Single

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

ClipLeft​

Gets or sets the left clipping of the contents.

public float ClipLeft { get; set; }
Public Property ClipLeft As Single

Property Value​

Single

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

ClipRight​

Gets or sets the right clipping of the contents.

public float ClipRight { get; set; }
Public Property ClipRight As Single

Property Value​

Single

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

ClipTop​

Gets or sets the top clipping of the contents.

public float ClipTop { get; set; }
Public Property ClipTop As Single

Property Value​

Single

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Height​

Gets the clipped height of the contents.

public float Height { get; }
Public Property Height As Single

Property Value​

Single

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

RequiredPdfObjects​

Gets the number of PDF objects required by the imported page data's contents.

public int RequiredPdfObjects { get; }
Public Property RequiredPdfObjects As Int32

Property Value​

Int32

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

ResourceType​

Gets the type of resource.

public ResourceType ResourceType { get; }
Public Property ResourceType As ResourceType

Property Value​

ResourceType

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Uid​

Gets the unique ID of the resource. (Inherited from Resource)

public long Uid { get; }
Public Property Uid As Int64

Property Value​

Int64

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Width​

Gets the clipped width of the contents.

public float Width { get; }
Public Property Width As Single

Property Value​

Single

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Methods​

Draw(DocumentWriter)​

Draws the contents the given DocumentWriter object.

public void Draw(DocumentWriter writer)
Sub Draw(writer As DocumentWriter)

Parameters​

DocumentWriter object to receive the contents output.

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

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​

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:

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:

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:

SetBoundaries(PageBoundary)​

Sets the boundaries of the page to the specified boundary on the imported page.

public void SetBoundaries(PageBoundary pageBoundary)
Sub SetBoundaries(pageBoundary As PageBoundary)

Parameters​

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

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:

See Also​

ceTe.DynamicPDF.Merger