ImportedPageData
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: ObjectPageElementImportedPageData
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
Properties
Angle | Gets or sets the angle of the page in degrees. |
Contents | Get the imported page data's ImportedPageContents object. |
Height | Gets or sets the height of the page. |
ID | Gets or sets the ID of the page element. (Inherited from PageElement) |
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) |
RelativeTo | Gets and sets placement of the page element on the page. (Inherited from PageElement) |
ScaleX | Gets or sets the horizontal scale of the page. |
ScaleY | Gets or sets the vertical scale of the page. |
Width | Gets or sets the width of the page. |
XOffset | Gets or sets the X offset of the page. |
YOffset | Gets or sets the Y offset of the page. |
Methods
Draw(PageWriter) | Draws the imported page data to the given PageWriter 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) |
ToString() | Returns a String that represents the current Object . (Inherited from Object) |