cete.dynamicpdf.merger.importedpagedata
ImportedPageData
- Namespace: ceTe.DynamicPDF.Merger
- Assemblies: DynamicPDF.CoreSuite.dll
Represents a Page Element containing the data of an imported page from a PDF document.
public class ImportedPageData : PageElement, ISerializable
Public Class ImportedPageData
Inherits PageElement
Implements ISerializable
Inheritance: Object → PageElement → ImportedPageData
Implements: ISerializable
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, scale that page and then place it on another blank page.
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 ImportedPage and add it to the document
Dim MyData As ImportedPageData = New ImportedPageData("C:\ImportPDF.pdf", 2, -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 ImportedPageData and add it to the page
ImportedPageData data = new ImportedPageData(inputFilePath, 2, -200, -100, 0.24f);
page.Elements.Add(data);
// Save the PDF
document.Draw(outputPath);
}
}
Remarks
This class can be used to pull a single selected page from an existing PDF document.
You can scale it or rotate it and you can place it on an another page.
Constructors
ImportedPageData(Byte[], Int32, [Optional] Single, [Optional] Single, [Optional] Single)
Initializes a new instance of the ImportedPageData class.
public ImportedPageData(Byte[] pdfData, int pageNumber, [float xOffset = 0], [float yOffset = 0], [float scale = 1])
Public Sub New (pdfData As Byte(), pageNumber As Integer, Optional xOffset As Single = 0, Optional yOffset As Single = 0, Optional scale As Single = 1)
Parameters
- pdfData: Byte[]
Byte arrat of the PDF document to import.
- pageNumber: Int32
Page number to import.
- xOffset: Single
X offset of the placement on the page.
- yOffset: Single
Y offset of the placement on the page.
- scale: Single
Scale of the imported page.
Licensing Info
This constructor 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.
ImportedPageData(ImportedPageContents)
Initializes a new instance of the ImportedPageData class.
public ImportedPageData(ImportedPageContents contents)
Public Sub New (contents As ImportedPageContents)
Parameters
- contents: ImportedPageContents
ImportedPageContents object containing the pages contents.
Licensing Info
This constructor 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.
ImportedPageData(ImportedPageContents, Single, Single)
Initializes a new instance of the ImportedPageData class.
public ImportedPageData(ImportedPageContents contents, float xOffset, float yOffset)
Public Sub New (contents As ImportedPageContents, xOffset As Single, yOffset As Single)
Parameters
- contents: ImportedPageContents
ImportedPageContents object containing the pages contents.
- xOffset: Single
X offset of the placement on the page.
- yOffset: Single
Y offset of the placement on the page.
Licensing Info
This constructor 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.
ImportedPageData(ImportedPageContents, Single, Single, Single)
Initializes a new instance of the ImportedPageData class.
public ImportedPageData(ImportedPageContents contents, float xOffset, float yOffset, float scale)
Public Sub New (contents As ImportedPageContents, xOffset As Single, yOffset As Single, scale As Single)
Parameters
- contents: ImportedPageContents
ImportedPageContents object containing the pages contents.
- xOffset: Single
X offset of the placement on the page.
- yOffset: Single
Y offset of the placement on the page.
- scale: Single
Scale of the imported page.
Licensing Info
This constructor 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.
ImportedPageData(PdfPage)
Initializes a new instance of the ImportedPageData class.
public ImportedPageData(PdfPage pdfPage)
Public Sub New (pdfPage As PdfPage)
Parameters
- pdfPage: PdfPage
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:
- 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.
ImportedPageData(PdfPage, Single, Single)
Initializes a new instance of the ImportedPageData class.
public ImportedPageData(PdfPage pdfPage, float xOffset, float yOffset)
Public Sub New (pdfPage As PdfPage, xOffset As Single, yOffset As Single)
Parameters
- pdfPage: PdfPage
PdfPage object to import.
- xOffset: Single
X offset of the placement on the page.
- yOffset: Single
Y offset of the placement on the page.
Licensing Info
This constructor 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.
ImportedPageData(PdfPage, Single, Single, Single)
Initializes a new instance of the ImportedPageData class.
public ImportedPageData(PdfPage pdfPage, float xOffset, float yOffset, float scale)
Public Sub New (pdfPage As PdfPage, xOffset As Single, yOffset As Single, scale As Single)
Parameters
- pdfPage: PdfPage
PdfPage object to import.
- xOffset: Single
X offset of the placement on the page.
- yOffset: Single
Y offset of the placement on the page.
- scale: Single
Scale of the imported page.
Licensing Info
This constructor 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.
ImportedPageData(String, Int32)
Initializes a new instance of the ImportedPageData class.
public ImportedPageData(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.
Licensing Info
This constructor 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.
ImportedPageData(String, Int32, Single, Single)
Initializes a new instance of the ImportedPageData class.
public ImportedPageData(string filePath, int pageNumber, float xOffset, float yOffset)
Public Sub New (filePath As String, pageNumber As Integer, xOffset As Single, yOffset As Single)
Parameters
- filePath: String
Physical file path of the PDF document to import.
- pageNumber: Int32
Page number to import.
- xOffset: Single
X offset of the placement on the page.
- yOffset: Single
Y offset of the placement on the page.
Licensing Info
This constructor 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.
ImportedPageData(String, Int32, Single, Single, Single)
Initializes a new instance of the ImportedPageData class.
public ImportedPageData(string filePath, int pageNumber, float xOffset, float yOffset, float scale)
Public Sub New (filePath As String, pageNumber As Integer, xOffset As Single, yOffset As Single, scale As Single)
Parameters
- filePath: String
Physical file path of the PDF document to import.
- pageNumber: Int32
Page number to import.
- xOffset: Single
X offset of the placement on the page.
- yOffset: Single
Y offset of the placement on the page.
- scale: Single
Scale of the imported page.
Licensing Info
This constructor 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.
Properties
Angle
Gets or sets the angle of the page in degrees.
public float Angle { get; set; }
Public Property Angle As Single
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.
Contents
Get the imported page data's ImportedPageContents object.
public ImportedPageContents Contents { get; }
Public Property Contents As ImportedPageContents
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.
Height
Gets or sets the height of the page.
public float Height { get; set; }
Public Property Height As Single
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.
ID
Gets or sets the ID of the page element. (Inherited from PageElement)
public string ID { get; set; }
Public Property ID 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.
IgnoreMargins
Gets or sets ignore margin property. Setting false will consider the margin while placing the page element based on the RelativeTo property. (Inherited from PageElement)
public bool IgnoreMargins { get; set; }
Public Property IgnoreMargins As Boolean
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.
Examples
The following example will place the Label in the top-left of the page with IgnoreMargin
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF(string outputPath)
{
// 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 Label and place it in page top left with margin ignored
Label label = new Label("I am placed in Page top left with margin ignored", 0, 0, 160, 30);
label.RelativeTo = RelativeTo.TopLeft;
label.IgnoreMargin=true; page.Elements.Add(label);
// Save the PDF
document.Draw(outputPath);
}
}
RelativeTo
Gets and sets placement of the page element on the page. (Inherited from PageElement)
public RelativeTo RelativeTo { get; set; }
Public Property RelativeTo As RelativeTo
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.
Examples
The following example will place the Label in the top-left of the page.
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF(string outputPath)
{
// 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 Label and place it in page top left with margin
Label label = new Label("I am placed in Page top left with margin.", 0, 0, 160, 30);
label.RelativeTo = RelativeTo.TopLeft;
page.Elements.Add(label);
// Save the PDF
document.Draw(outputPath);
}
}
ScaleX
Gets or sets the horizontal scale of the page.
public float ScaleX { get; set; }
Public Property ScaleX As Single
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.
ScaleY
Gets or sets the vertical scale of the page.
public float ScaleY { get; set; }
Public Property ScaleY As Single
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.
Width
Gets or sets the width of the page.
public float Width { get; set; }
Public Property Width As Single
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.
XOffset
Gets or sets the X offset of the page.
public float XOffset { get; set; }
Public Property XOffset As Single
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.
YOffset
Gets or sets the Y offset of the page.
public float YOffset { get; set; }
Public Property YOffset As Single
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
Draw(PageWriter)
Draws the imported page data to the given PageWriter object.
public void Draw(PageWriter writer)
Sub Draw(writer As PageWriter)
Parameters
- writer: PageWriter
PageWriter object to receive the imported page data output.
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.
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.
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.