Class InitialPromptSettings
The SmartPdfViewer is an AI-powered control that extends the Syncfusion.Blazor.SfPdfViewer. It allows for seamless interaction with PDF documents by incorporating AI-assisted functionalities.
Inheritance
Namespace: Syncfusion.Blazor.SmartPdfViewer
Assembly: Syncfusion.Blazor.SmartPdfViewer.dll
Syntax
public class InitialPromptSettings : SfBaseComponent
Examples
<SfSmartPdfViewer Height="100%" width="100%">
<AssistViewSettings>
<InitialPromptSettings Prompt = "Explain this document."/>
</AssistViewSettings>
</SfSmartPdfViewer>
Constructors
InitialPromptSettings()
Declaration
public InitialPromptSettings()
Properties
PageEnd
Gets or sets the ending page number for the document overview.
Declaration
public int PageEnd { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | An integer representing the ending page number. The default value is 10. |
Remarks
This property works in the initial overview alone for better performance. Based on the document text, the AI token limit can be exceeded.
Examples
<SfSmartPdfViewer>
<AssistViewSettings>
<InitialPromptSettings PageEnd="1"/>
</AssistViewSettings>
</SfSmartPdfViewer>
PageStart
Gets or sets the starting page number for the document overview.
Declaration
public int PageStart { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | An integer representing the starting page number, starting from one. |
Remarks
This property works in the initial overview alone for better performance.
Examples
<SfSmartPdfViewer>
<AssistViewSettings>
<InitialPromptSettings PageStart="1"/>
</AssistViewSettings>
</SfSmartPdfViewer>
Prompt
Gets or sets the current prompt text.
Declaration
public string Prompt { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the prompt text. |
Examples
<SfSmartPdfViewer>
<AssistViewSettings>
<InitialPromptSettings Prompt ="Search this document"/>
</AssistViewSettings>
</SfSmartPdfViewer>
SuggestedPrompts
Gets or sets the initial suggestions to be used in the Assist view of the PDF viewer. These suggestions help guide the AI's initial analysis or user interaction.
Declaration
public string[] SuggestedPrompts { get; set; }
Property Value
Type | Description |
---|---|
System.String[] | A list of strings representing initial suggestions. |
Remarks
Use the SuggestedPrompts
property to provide predefined prompts that assist the AI in understanding the context or guiding the user.
This can improve the relevance and efficiency of the AI responses, especially in structured document workflows.
Examples
The following example demonstrates how to specify initial suggestions for the AI Assist view:
<SfSmartPdfViewer>
<AssistViewSettings>
<InitialPromptSettings SuggestedPrompts="@CustomSuggestion" />
</AssistViewSettings>
</SfSmartPdfViewer>
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder | __builder |
OnParametersSet()
Executes when the parameters were set to this component
Declaration
protected override void OnParametersSet()