cete.dynamicpdf.merger.importedpagecontents
ImportedPageContents
- Namespace: ceTe.DynamicPDF.Merger
- Assemblies: ceTe.DynamicPDF.40.dll
Represents the contents used by an the ImportedPageData class.
public class ImportedPageContents : Resource
Public Class ImportedPageContents
Inherits Resource
Inheritance: Object → Resource → ImportedPageContents
Licensing
This class is a DynamicPDF Merger Professional Edition feature. One of the following licenses is required for non-evaluation usage:
- DynamicPDF Merger for .NET Professional Edition
- DynamicPDF Merger for .NET Enterprise Edition
- DynamicPDF Core Suite for .NET Professional Edition
- DynamicPDF Core Suite for .NET Enterprise Edition
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;
class MyClass
{
static void Main()
{
// 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( @"C:\ImportPDF.pdf", 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 PDF
document.Draw( @"C:\MyDocument.pdf" );
}
}
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(PdfPage)
Initializes a new instance of the ImportedPageContents class.
public ImportedPageContents(PdfPage pdfPage)
Public Sub New (pdfPage As PdfPage)
Parameters
- pdfPage: PdfPage
PdfPage object to import.
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: PdfPage
PdfPage object to import.
- pageBoundary: PageBoundary
The boundaries box to use as the edges of the page.
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
- filePath: String
Physical file path of the PDF document to import.
- pageNumber: Int32
Page number to import.
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
- filePath: String
Physical file path of the PDF document to import.
- pageNumber: Int32
Page number to import.
- pageBoundary: PageBoundary
The boundaries box to use as the edges of the page.
Properties
ClipBottom
Gets or sets the bottom clipping of the contents.
public float ClipBottom { get; set; }
Public Property ClipBottom As Single
Property Value
ClipLeft
Gets or sets the left clipping of the contents.
public float ClipLeft { get; set; }
Public Property ClipLeft As Single
Property Value
ClipRight
Gets or sets the right clipping of the contents.
public float ClipRight { get; set; }
Public Property ClipRight As Single
Property Value
ClipTop
Gets or sets the top clipping of the contents.
public float ClipTop { get; set; }
Public Property ClipTop As Single
Property Value
Height
Gets the clipped height of the contents.
public float Height { get; }
Public Property Height As Single
Property Value
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
ResourceType
Gets the type of resource.
public ResourceType ResourceType { get; }
Public Property ResourceType As ResourceType
Property Value
Uid
Gets the unique ID of the resource. (Inherited from Resource)
public long Uid { get; }
Public Property Uid As Int64
Property Value
Width
Gets the clipped width of the contents.
public float Width { get; }
Public Property Width As Single
Property Value
Methods
Draw(DocumentWriter)
Draws the contents the given DocumentWriter object.
public void Draw(DocumentWriter writer)
Sub Draw(writer As DocumentWriter)
Parameters
- writer: DocumentWriter
DocumentWriter object to receive the contents output.
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.
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 .
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.
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
- pageBoundary: PageBoundary
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 .