RadFixedPage
RadFixedPage is the main page unit that builds a PDF document (RadFixedDocument). It conforms to the IContentRootElement interface and is the root element of all fixed content elements in the document model. Figure 1 in the Model article demonstrates in details the structure of the document model.
This article covers the following topics:
What Is RadFixedPage
The root element in the document model tree is RadFixedDocument. The document, on the other hand, consists of RadFixedPages hosting all content elements. You can add a RadFixedPage to a document in several ways.
RadFixedPage exposes the following properties:
Property Name | Description |
---|---|
Content | The content elements collection. |
Annotations | Collection that contains all Annotations in the RadFixedPage. |
MediaBox | Defines the boundaries of the physical medium on which the page will be printed. Any content falling outside this boundary is discarded without affecting the meaning of the PDF file. |
CropBox | Defines the region to which the contents of the page are clipped (cropped) when displayed or printed. This boundary determines the visible page content. The default value is the page’s media box. |
Size | Property of type Size representing the size of the page. Its value is determined by the width and height of the MediaBox. |
Rotation | Property of type Rotation representing the page rotation. |
Actions | Gets the page actions collection. |
Example 1 demonstrates how to create a new RadFixedPage instance and add it to the Pages collection of RadFixedDocument.
Example 1: Create RadFixedPage and add it to a document
RadFixedDocument document = new RadFixedDocument();
RadFixedPage page = new RadFixedPage();
document.Pages.Add(page);
Operating with RadFixedPage
There are several operations, which you can execute directly over a RadFixedPage instance.
Add Content
RadFixedPage is designed to hold any content element in the document model. There are several ways to achieve that.
Example 2 shows how to add a previously created ContentElement in a RadFixedPage.
Example 2: Add content element to RadFixedPage
RadFixedPage page = new RadFixedPage();
page.Content.Add(contentElement);
Add Annotation
You can add different annotations in RadFixedPage by using the Annotations collection.
Example 3 shows how to add a previously created annotation in a RadFixedPage.
Example 3: Add annotation to RadFixedPage
RadFixedPage page = new RadFixedPage();
page.Annotations.Add(annotation);
Modifying Properties
RadFixedPage's API provides you with the ability to modify its properties.
Example 4 shows how you can change the Rotation and Size properties of a RadFixedPage.
Example 4: Change properties of a RadFixedPage
RadFixedPage page = new RadFixedPage();
page.Rotation = Rotation.Rotate270;
page.Size = new Size(792, 1128);
A complete SDK example how to generate a document is available here.