Class AssistViewSettings
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 AssistViewSettings : SfBaseComponent
Examples
<SfSmartPdfViewer Height="100%" width="100%">
<AssistViewSettings Prompt = "Explain this document."/>
</SfSmartPdfViewer>
Constructors
AssistViewSettings()
Declaration
public AssistViewSettings()
Properties
ChildContent
Renders the child element
Declaration
public RenderFragment ChildContent { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.RenderFragment |
Enable
Gets or sets a value indicating whether the Assist view and its features are enabled in the PDF viewer.
When set to false
, the Assist view button in the toolbar will be disabled and all assistive functionality will be inaccessible to users.
Declaration
public bool Enable { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
Use the Enable
property to control the visibility and availability of AI assistant capabilities within the viewer.
If set to false
, the Assist view launch button will be disabled in the toolbar, and users will not be able to initiate any assistive actions.
This is useful for scenarios requiring restricted or standard PDF viewing without AI enhancements.
Examples
The following example demonstrates how to enable the Assist view and its features in the PDF viewer:
<SfSmartPdfViewer>
<AssistViewSettings Enable="false" />
</SfSmartPdfViewer>
MaxRetryAttempts
Gets or sets the maximum number of retry attempts for AI processing.
Declaration
public int MaxRetryAttempts { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | An integer setting the minimum number of retry attempts . The dafault value is 3. |
Remarks
This property determines how many retry attempts are made before an error message is displayed.
Examples
<SfSmartPdfViewer>
<AssistViewSettings MaxRetryAttempts="3"/>
</SfSmartPdfViewer>
MinLength
Gets or sets the minimum content length (in characters) required in the document to enable AI processing in the Assist view. If the document contains less than the specified minimum number of characters, an error message box will be displayed and AI processing will not be activated.
Declaration
public int MinLength { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | An |
Remarks
Use the MinContentLength
property in AssistViewSettings
to ensure that documents contain a sufficient amount of text for meaningful AI-driven analysis.
If the loaded document does not meet the specified minimum character count, users will be notified with an error dialog, and no further AI actions will be performed until the requirement is met.
Examples
The following example shows how to require a minimum content length before enabling AI features:
<SfSmartPdfViewer>
<AssistViewSettings MinLength="100" />
</SfSmartPdfViewer>
Placeholder
Gets or sets the placeholder text for the input field.
Declaration
public string Placeholder { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the placeholder text. |
Examples
<SfSmartPdfViewer>
<AssistViewSettings Placeholder="Enter your query..." />
</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 Prompt = "Search this document."/>
</SfSmartPdfViewer>
PromptChanged
Gets or sets the callback that is triggered when the prompt content is modified by the user.
Declaration
public EventCallback<string> PromptChanged { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.String> | A callback delegate of type Microsoft.AspNetCore.Components.EventCallback<> that provides the updated prompt text. |
Remarks
This event allows developers to track user input in real time or take action whenever the prompt changes.
Examples
<SfSmartPdfViewer>
<AssistViewSettings PromptChanged="@OnPromptChanged" />
</SfSmartPdfViewer>
@code {
private void OnPromptChanged(string newPrompt)
{
Console.WriteLine($"Prompt changed: {newPrompt}");
}
}
ShowPromptSuggestions
Gets or sets a value indicating whether prompt suggestions are shown.
Declaration
public bool ShowPromptSuggestions { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Examples
<SfSmartPdfViewer>
<AssistViewSettings ShowPromptSuggestions="false" />
</SfSmartPdfViewer>
StreamResponse
Gets or sets a value indicating whether AI responses should be streamed to the user in real time. When enabled, responses are displayed incrementally as they are generated, providing a smoother user experience.
Declaration
public bool StreamResponse { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
Setting StreamResponse
to true
allows users to see AI-generated content as it becomes available,
improving perceived performance and interactivity in scenarios where responses are generated over time.
Examples
The following example illustrates how to enable streaming responses in the Assist view:
<SfSmartPdfViewer>
<AssistViewSettings StreamResponse="true" />
</SfSmartPdfViewer>
Timeout
Gets or sets the timeout duration in seconds for AI processing.
Declaration
public int Timeout { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | An integer setting the minimum number of timeout seconds . The default value is 30. |
Remarks
This property determines whether AI processing will stop responding for the specified timeout duration (in seconds).
Examples
<SfSmartPdfViewer>
<AssistViewSettings Timeout="30"/>
</SfSmartPdfViewer>
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder | __builder |
OnParametersSet()
Called when the parameters are set for the component.
Declaration
protected override void OnParametersSet()