Available for: UI for ASP.NET MVC | UI for ASP.NET AJAX | UI for Blazor | UI for WPF | UI for WinForms | UI for Xamarin | UI for WinUI | UI for ASP.NET Core | UI for .NET MAUI

New to Telerik Document Processing? Download free 30-day trial

PageRef Field

The PageRef field inserts the page number of a bookmark for a cross-reference.

Field Syntax

This is how the syntax of a PageRef field looks like:

Syntax
{ PAGEREF Bookmark [\* Format Switch ] }

Switches

Switches are a way for the code fragment to specify formatting for the result of the field. More information is available in the Syntax and Switches section of the Fields article.

The possible switches for a Date field are:

Switches Description
\h Creates a hyperlink to the bookmarked paragraph.
\p Causes the field to display its position relative to the source bookmark.

Inserting

Inserting this field is easily achieved through the RadFlowDocumentEditor's InsertField() method. It accepts code as first argument and result as second argument.

Example 1 demonstrates how you can insert a PageRef field.

Example 1: Insert PageRef field

editor.InsertText("Bookmark Page: "); 
editor.InsertField("PAGEREF mybookmark", ""); 

After updating the field the result would be "Bookmark Page: 2" (check Updating Fields).

See Also

In this article