关于 syncfusion-blazor-pdf-viewer
为 Blazor 项目生成 Syncfusion Blazor PDF Viewer 的 C# 和 Razor 示例,面向集成该组件的开发者。技能要求仅依据参考文件中的 API 编写代码,并在 API 未记录或参考文件缺失时停止生成。
主要功能
- 01生成可集成的 C# 和 Razor 示例
- 02检查项目类型与配置文件
- 03仅使用参考表中记录的 API
- 04覆盖工具栏、缩放、搜索和批注
- 05缺少参考文件时停止生成
适用场景
- 01为 Blazor 页面添加 PDF Viewer
- 02按需配置工具栏或缩放
- 03实现 PDF 文本搜索与批注
- 04确认功能是否有文档支持
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ syncfusion/ pdf-viewer-sdk-skills --skill syncfusion-blazor-pdf-viewer安装后在 Claude Code 中输入/syncfusion-blazor-pdf-viewer确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
README.mdreferences/annotation-enum-properties.mdannotation-events.mdannotation-general-enum-properties.mdannotation-methods.mdannotation-properties.mdannotation-selector-settings.mdannotation-settings-enum-properties.mdannotation-settings.mdarea-annotation-settings.mdarrow-annotation-settings.mdazure-container-deployment.mdcircle-annotation-settings.mdcommand-manager.mdcommand-panel.mdcontextmenu-settings.mdcustom-stamp-annotation-settings.mddistance-annotation-settings.mddocument-properties.mdfile-save-properties.mdform-designer-events.mdform-field-properties.mdform-field-settings.mdform-fields-enum-properties.mdfree-text-annotation-settings.mdgeneral-enum-properties.mdgetting-started.mdhandwritten-signature-settings.mdhighlight-annotation-settings.mdink-annotation-settings.md详细介绍
Syncfusion Blazor Pdfviewer – UI 示例
NuGet: Syncfusion.Blazor.SfPdfViewer + Syncfusion.Blazor.Themes
命名空间: Syncfusion.Blazor.SfPdfViewer
为用户的项目生成 C# 代码 (默认)
触发关键词:“如何操作”“添加 pdfviewer”“代码示例”“给我看看”“示例”“代码片段”“集成”“组件”“创建示例”。
**用途:**生成精简、可直接复制粘贴的 C# 和 Razor 代码,供用户直接集成到其 Blazor 项目中。
工作流:
⚠️ 严重警告 — 功能支持政策(严格模式):
**基本规则:**只能使用参考文件中明确列出的 API 和属性生成代码。任何偏离均属违规。
-
生成任何代码前必须完成的检查:
- 在参考文件中搜索确切的 API/属性名称
- 确认其出现在方法参考、属性或事件表中
- 如果任何参考文件中都未找到,立即停止
- 在任何情况下都不得生成或建议未记录的 API
-
严格执行 — 零容忍:
- 不得使用自定义属性——只能使用参考文件表格中的属性
- 不得虚构方法——只能使用参考文件表格中的方法
- 不得使用未定义 API 作为变通方案——严禁
- 不得假设未记录的行为——严禁
- 不得使用猜测的替代实现——严禁
- 不得假装功能受支持——严禁
-
不受支持功能的强制回复:
- 如果请求的场景/功能/API 未列于任何参考文件中,必须回复:
"This feature is not supported in the current Syncfusion Blazor PDF Viewer implementation." - 然后列出相应参考文件中确实受支持的内容
- 除非参考文件中有明确记录,否则不得建议替代方案
- 如果请求的场景/功能/API 未列于任何参考文件中,必须回复:
-
参考文件层级:
- 每个参考文件都包含其所属领域完整且权威的文档
- 表格(方法参考、属性、事件)是唯一事实来源
- 参考文件中这些表格以外的内容仅用于说明
- 不得超出参考文件表格中列出的内容
-
审核生成内容:
- 提供任何代码之前,确认其中使用的每个 API 都出现在参考文件表格中
- 记录每个 API 所属的参考文件
- 如果无法引用参考文件表格中的条目,删除相应代码
-
**这是关键要求。**违反要求会损害此技能的完整性和可靠性。
步骤 1 — 检测应用类型 (必须执行 — 不得跳过)
- 使用 file_search 和 read_file 工具检查工作区项目文件:
.csproj文件(项目配置)Program.cs(启动配置)_Imports.razor(命名空间导入)App.razor(根组件)- Components/Pages 中任何现有的
.razor文件
- **输出:**继续操作前,确认检测到的应用类型(例如,“Blazor WebApp”或“Blazor Server”)。
步骤 2 — 仅根据参考文件生成代码 (必需)
- 生成前: 确认步骤 1 已完成
- 阅读与所请求功能相关的
references/*.md文件 - 对照这些表格核查每个 API、属性和方法
- 仅声明式方式(强制 — 不使用生命周期方法):
- 仅在 Razor 标记中使用类似生命周期方法的属性绑定。
- 将所有 PDF Viewer 属性直接配置为组件属性
- 强制要求: 生成任何代码前,验证参考文件存在且可访问
- 阅读所请求功能对应的参考文件:
- 对相关的
references/*.md文件使用read_file工具 - 确认文件包含 Methods/Properties/Events 表格
- 验证表格完整且可读
- 对相关的
- 如果参考文件缺失或无法读取:
- 停止生成代码
- 回复:“此功能的参考文件不可用。请确保所有参考文件都位于
references/目录中。” - 列出缺失的参考文件名
- 此步骤为阻断项: 未验证参考文件前不得继续
- 如果某个 API/属性未出现在参考文件表格中,不要使用它
- 不要编造、猜测或建议参考文件中未明确列出的任何 API、方法、属性、类或命名空间
代码参考
所有模板和操作代码片段都位于 references/*.md 中。每个文件都是聚焦的代码片段或模板,Agent 会在生成示例时组合使用。
流程: 始终从 getting-started.md 开始,然后将匹配的功能合并到其中的锚点(PROPS、EVENTS、UI_BUTTONS、HANDLERS)。如果没有匹配的关键词,则仅返回基本示例。
| 文件 | 用途 |
|---|---|
| getting-started.md | 基础设置和最简 PDF Viewer 组件。包含完整的设置先决条件。提供具有 DocumentPath、Height、Width 属性和功能锚点的最简可用组件。可作为所有 PDF Viewer 实现的基础,并包含适当的项目设置和配置验证。 |
| toolbar-properties.md | 使用 PdfViewerToolbarSettings 全面自定义工具栏。包含 11 个属性(ShowTooltip、EnableToolbar、EnableAnnotationToolbar、IsAnnotationToolbarVisible、ToolbarSettings、ToolbarClicked、ToolbarItems、AnnotationToolbarItems、FormDesignerToolbarItems、MobileToolbarItems、RedactionToolbarItems、CustomToolbarItems)、5 种专用工具栏(Primary、Annotation、FormDesigner、Mobile、Redaction),分别包含 14/22/9/7/7 个项目,以及 7 个代码示例。可用于简化工作流的 UI、创建基于角色的工具访问权限、优化移动体验、添加自定义功能,以及控制注释/表单/涂黑功能。 |
| toolbar-methods.md | 用于控制工具栏可见性和行为的编程方法。包含 5 个方法(ShowToolbarAsync、ShowAnnotationToolbar、ShowRedactionToolbar、EnableToolbarItemsAsync、ShowToolbarItemsAsync),以及用于精细控制的 14 个工具栏项目(OpenOption、PrintOption、DownloadOption、SearchOption、MagnificationTool、PageNavigationTool、SelectionTool、PanTool、AnnotationEditTool、CommentTool、FormDesigner、SubmitForm、UndoRedoTool、Redaction)。 |
| magnification.md | 通过编程控制缩放,包含 10 个属性、7 个方法、1 个事件和全面的选择指南。属性:ZoomMode(Default/FitToPage/FitToWidth/FitToHeight)、ZoomValue(10-400%)、MinZoomValue、MaxZoomValue、EnableMagnification、EnablePinchZoom、EnableZoomOptimization、RestrictZoomRequest、ZoomValueChanged 回调、TileRenderingSettings。方法:ZoomAsync(精确缩放百分比)、ZoomInAsync(逐步缩放至预设值)、ZoomOutAsync(逐步缩放至预设值)、FitToPageAsync、FitToWidthAsync、FitToHeightAsync、GetZoomPercentageAsync。事件:ZoomChanged(CurrentZoomValue、PreviousZoomValue)。 |
| text-search.md | PDF 文档内容发现和导航的完整文本搜索功能。使用 EnableTextSearch 属性切换搜索功能。文本搜索方法(共 4 个):SearchTextAsync(string searchText、bool isMatchCase,用于区分大小写或不区分大小写的搜索)、SearchNextAsync(导航至下一个结果)、SearchPreviousAsync(导航至上一个结果)、CancelTextSearchAsync(清除高亮并取消搜索)。搜索配置:PdfViewerTextSearchColorSettings,包含 SearchColor(找到的文本颜色)、SearchHighlightColor(高亮文本颜色),用于视觉自定义。搜索事件(共 3 个):OnTextSearchStart(SearchText、MatchCase 参数)、OnTextSearchComplete(用于跟踪搜索完成情况的 SearchText、MatchCase)、OnTextSearchHighlight(用于跟踪结果位置的 PageNumber、坐标)。 |
| annotation-events.md | 注释生命周期、交互和签名专用事件的全面参考(共 20 多个事件)。包含事件订阅模式、事件类别(添加/修改/删除、选择/移动/调整大小、签名操作)、附带详细参数和属性的完整事件列表,以及相关类型定义。 |
| annotation-properties.md | 启用/禁用 13 种以上注释功能类型(FreeText、Shape、TextMarkup、StickyNotes、Ink、手写签名、Measure、Stamp、Image)的参考,使用布尔属性进行控制。包含编程方法(SetAnnotationModeAsync、UpdateMeasurementSettingsAsync)、导出配置(文件名、格式)、签名控制(可编辑性、数字外观),以及全面的类型定义(AnnotationType、DynamicStampItem、SignStampItem、StandardBusinessStampItem)。 |
| annotation-settings.md | 20 多种注释类型的默认外观、行为、尺寸限制和约束配置(22 种以上设置类)。属性用于控制颜色(描边、填充、字体、边框)、尺寸限制(最小/最大宽度和高度)、锁定(IsLock、AllowedInteractions)、是否包含在打印/下载内容中,以及作者信息。 |
| redaction-settings.md | 用于从 PDF 中永久删除敏感信息的涂黑设置完整配置 API。核心覆盖层属性(共 9 个):OverlayText、MarkerFillColor、MarkerBorderColor、MarkerOpacity(透明度 0-1)、FontColor、FontSize、FontFamily、IsRepeat、TextAlignment。安全和控制属性:AllowedInteractions、IsLock、Author、CustomData、IsPrint。尺寸限制:MinWidth、MaxWidth、MinHeight、MaxHeight,用于控制尺寸。下载/打印控制:SkipPrint、SkipDownload、IsPrint,用于控制文档持久化。视觉样式:BorderDashArray、FillColor、Opacity、StrokeColor、Thickness。注释选择器设置。 |
| programmatical-annotation-methods.md | 用于编程管理注释生命周期、涂黑以及导出/导入工作流的完整 API。注释 CRUD 方法(共 15 个):AddAnnotationAsync(4 种变体,分别用于基本注释、DynamicStamp、SignStamp、StandardBusinessStamp)、AddAnnotationsAsync(批量)、EditAnnotationAsync、DeleteAnnotationAsync(3 种变体:无参数/按对象/按 ID)、DeleteAnnotationsAsync(3 种变体)、GetAnnotationsAsync、SelectAnnotationAsync(2 种变体)、ClearSelectionAsync。涂黑方法:AddPageRedactionsAsync、RedactAsync(永久涂黑)。导出/导入:ExportAnnotationAsync(Json/Xfdf 格式)、ExportAnnotationAsStreamAsync、ExportAnnotationsAsObjectAsync、ImportAnnotationAsync(流/对象)。 |
| command-manager.md | 自定义键盘快捷键和批注面板自定义的双功能参考。命令管理器:PdfViewerCommandManager,使用 KeyboardCommand/KeyGesture 将组合键映射到自定义操作,并通过 CommandExecutedEventArgs 传递事件。批注面板设置:PdfViewerCommentPanelSettings,包含 Multiline(启用详细的多行批注)、DateTimeFormat(自定义时间戳格式)和可见性控制(CommentPanelVisible 布尔值、用于双向绑定的 CommentPanelVisibleChanged 事件)。 |
| document-properties.md | PDF 处理的文档级配置、元数据和生命周期事件。属性:EnableChunkMessages(用于处理大文件)。事件(共 8 个):DocumentLoaded、DocumentLoadFailed、DocumentUnloaded、DocumentEdited(EditingAction:AnnotationAdded/Deleted/Updated、FormFieldImported/Updated)、PageMouseover(PageX/Y 坐标)、OnPageClick(点击坐标)。 |
| file-save-properties.md | 文件下载以及注释导出/导入功能,包含完整的事件驱动工作流。属性:EnableDownload(切换工具栏下载按钮)。方法:DownloadAsync(references),用于以编程方式下载文档。事件(共 8 个):DownloadStart(FileName)、DownloadEnd(DownloadDocument base64 字符串、FileName)、ExportStarted、ExportSucceed(FileName)、ExportFailed(ErrorDetails)、ImportStarted、ImportSucceed、ImportFailed(ErrorDetails)。适用于文档持久化工作流、下载跟踪和日志记录、注释导出/导入操作、为文件操作提供用户反馈,以及处理导入/导出失败错误。 |
| ui-properties.md | 用于自定义查看器体验的核心 UI 属性和超链接交互事件。包含 4 个属性(EnableDesktopMode、EnableErrorDialog、EnableHyperlink、EnableRtl),用于控制 UI 行为和设备模式;3 个事件(OnHyperlinkClick、OnHyperlinkMouseOver、Created),用于处理超链接导航和生命周期;以及 4 个代码示例。可用于自定义查看器在不同设备上的外观、控制超链接导航、管理错误处理,并支持国际化(RTL)。 |
| form-field-properties.md | 核心表单字段配置和设计模式控制(4 个属性、1 个方法)。属性:EnableFormDesigner(启用/禁用表单设计器工具)、EnableFormFields(控制用户与现有字段的交互)、EnableFormFieldsValidation(启用自动验证)、IsFormFieldDocument(只读,用于检测 PDF 中的表单字段)、EnableAutoComplete(表单字段自动完成)。方法:SetFormDrawingModeAsync(FormFieldType?),用于以编程方式设置表单字段绘制模式,支持 8 种字段类型(Button、CheckBox、DropDown、ListBox、Password、RadioButton、SignatureField、Textbox)。可用于控制表单设计器工作流、管理表单字段交互、设置自动验证、检测文档功能,以及动态切换表单字段类型。 |
| form-field-settings.md | 表单字段的视觉外观和样式配置,包含 7 个属性和全面的选择指南。属性:BackgroundColor(HEX/RGB/CSS 颜色)、BorderColor、Color(文本颜色)、FontFamily、FontSize(double 类型)、FontStyle、Thickness。 |
| form-designer-events.md | 表单字段生命周期、交互、验证和数据管理的全面事件参考(20 多个事件)。事件类别:生命周期(FormFieldAdding/Added/Deleted/PropertyChanged,支持取消)、交互(Selected/Unselected/Click/DoubleClick/Resized/FocusIn/FocusOut,包含坐标)、鼠标(MouseEnter/Leave,包含 PageX/PageY)、验证(ValidateFormFields,包含 UnfilledFields 字典)、导入/导出(Importing/Imported/ImportFailed、Exporting/Exported/ExportFailed,包含 ErrorDetails)、设计器模式(IsDesignerModeChanged)。 |
| programmatical-form-field-methods.md | 用于编程管理表单字段生命周期、批量操作和导出/导入工作流的完整 API。表单字段 CRUD 方法(共 13 个):AddFormFieldsAsync(批量添加)、GetFormFieldsAsync(获取全部)、UpdateFormFieldsAsync(单个/批量变体)、DeleteFormFieldsAsync(3 种变体:全部/所选/按 ID)、SelectFormFieldAsync(按对象/按 ID)、RetrieveFormFieldsAsync(旧版)。导出/导入:ExportFormFieldsAsync(带格式参数)、ExportFormFieldsAsObjectAsync、ImportFormFieldsAsync(带格式参数的 Dictionary/Stream 变体)。 |
| thumbnail-bookmark.md | 编程导航、文本选择以及缩略图/书签面板管理的全面参考。包含 5 个方法(ClearTextSelectionAsync、GetBookmarksAsync、GoToBookmarkAsync、OpenThumbnailPaneAsync、SelectTextRegionAsync)、4 个 UI 属性(EnableBookmarkPanel、EnableTextSelection、EnableThumbnailPanel、IsThumbnailPanelOpen)和 3 个交互事件(OnTextSelectionEnd、OnTextSelectionStart、OnThumbnailClick)。可用于实现自定义导航 UI、以编程方式高亮文本、创建基于书签的工作流,以及管理文本选择。 |
| contextmenu-settings.md | 当用户需要自定义 PDF Viewer 的上下文菜单设置及其属性时使用。可用于自定义上下文菜单功能中的选项、修改选项,并说明其行为。 |
| undo-redo-properties.md | 用于跟踪和还原文档更改的全面撤消/重做功能。包含 4 个属性(CanUndo、CanUndoChanged、CanRedo、CanRedoChanged),用于跟踪撤消/重做状态,并通过事件回调实现双向绑定;包含 2 个异步方法(UndoAsync、RedoAsync),用于执行撤消/重做操作;以及 2 个代码示例。跟踪所有用户操作,包括注释、表单字段输入、编辑和修改。可用于实现撤消/重做按钮、跟踪文档编辑历史、提供键盘快捷键(Ctrl+Z/Ctrl+Y),以及管理文档状态更改。 |
| navigation-methods.md | 编程控制页面导航并检索文档信息(共 9 个方法)。方法:GoToFirstPageAsync/GoToLastPageAsync/GoToNextPageAsync/GoToPreviousPageAsync、用于跳转的 GoToPageAsync(从 1 开始索引)、GetPageCountAsync(异步获取总页数)、GetPageDetails(同步获取页面元数据 List)、ShowNavigationToolbarAsync(bool)(工具栏可见性)、ToggleItemByIndex(int)(切换面板)。实现说明:索引从 1 开始;所有 GoTo* 方法均为异步(需要 await);GetPageCountAsync 为异步;GetPageDetails 为同步;页码无效时保持当前页。 |
| navigation-properties.md | 用于跟踪页面状态、自定义导航工具栏和同步 PDF Viewer UI 的属性。包含 CurrentPageNumber、PageCount 以及事件回调(CurrentPageNumberChanged、PageCountChanged),用于实时监控页面。配置 NavigationToolbarSettings,以显示/隐藏内置项目(Thumbnails、Bookmarks、CommentPanel、PageOrganizer),或为 Navigation Toolbar 添加自定义工具栏按钮和分隔符 |
| page-organizer.md | 用于编程操作页面、编辑文档结构以及配置页面整理器 UI 的完整 API。页面操作方法(共 8 个):DeletePagesAsync、DuplicatePagesAsync、ExtractPagesAsync、ExtractPagesAsStreamAsync、InsertPagesAsync、InsertBlankPagesAsync、MovePagesAsync、RotatePagesAsync、RotatePagesToAngleAsync,支持按索引操作页面(从 0 开始)。PageOrganizerSettings 提供功能控制(CanDelete、CanInsert、CanRotate、CanDuplicate、CanRearrange、CanImport、CanExtractPages)、缩略图缩放管理(ImageZoom、ShowImageZoomingSlider、ImageZoomMin/Max)和页脚按钮可见性(Save/SaveAs)。事件:PageOrganizerSaveRequested、PageOrganizerZoomChanged、PageSelected(SelectedPages 列表),用于保存/缩放工作流。 |
| page-organizer-settings.md | 页面整理器功能的专用设置配置。属性(共 12 个):CanDelete、CanInsert、CanRotate、CanDuplicate、CanRearrange、CanImport、CanExtractPages(布尔功能开关)、ImageZoom(缩略图缩放级别)、ShowImageZoomingSlider、ImageZoomMin/ImageZoomMax、FooterButtons(用于控制 Save/SaveAs 可见性的 FooterButton 枚举)。与 PageOrganizerSettings 标记配合使用,可精细控制允许执行的页面操作并配置缩略图缩放行为。 |
| print.md | PDF 文档的打印功能配置、质量控制和事件驱动工作流。打印控制属性(共 4 个):EnablePrint(用于切换工具栏打印按钮的布尔值)、EnablePrintRotation(打印时自动旋转横向文档的布尔值)、PrintScaleFactor(打印图像质量)、PrintMode(用于指定打印对话框位置的 Default/NewWindow 枚举)。打印方法:PrintAsync(references),用于以编程方式打印。打印事件(共 2 个):PrintStart(用于权限验证的 Cancel 布尔值、用于跟踪文档的 FileName)、PrintEnd(用于审计日志和打印后操作的 FileName)。 |
| pdfviewer-properties.md | 控制 UI 外观和查看器行为的 Blazor SfPdfViewer 组件通用配置属性。属性(共 15 个):Height、Width(可滚动尺寸)、Id(DOM 元素 ID)、CssClass(自定义样式)、DocumentPath(初始 PDF 路径)、DownloadFileName(下载文件名)、Locale(区域性/本地化)、InteractionMode、HyperlinkOpenState、CustomFonts(文档文本的本地字体路径)、FallbackFontCollection(用于自定义 FreeText 字体的 Dictionary<string, Stream>)、FontFamilies(首选字体列表)、RetryCount(服务调用重试次数)、IsDocumentEdited(只读编辑状态跟踪)。可用于配置查看器的初始外观、字体支持、交互行为和本地化。 |
| pdfviewer-methods.md | Blazor SfPdfViewer 组件的核心生命周期和文档操作方法。方法(共 8 个):LoadAsync(string/Stream/byte[], password),用于从路径/URL/流/字节数组加载 PDF;SaveAsync(filePath),用于在服务器端保存;UnloadAsync(references),用于清理内存;GetDocumentAsync(references),用于以 byte[] 获取修改后的文档;UpdateViewerContainerAsync(references),用于响应式布局重排;DownloadAsync(references),用于浏览器下载;Dispose(references)/Dispose(bool),用于清理资源。可用于以编程方式管理文档生命周期、从不同来源加载 PDF、保存更改,以及调整容器响应布局。 |
| annotation-methods.md | Blazor SfPdfViewer 的编程注释模式控制方法。方法(共 2 个):SetAnnotationModeAsync(AnnotationType),用于激活指定注释类型,以供用户进行下一次交互;SetAnnotationModeAsync(AnnotationType, DynamicStampItem?, SignStampItem?, StandardBusinessStampItem?) 重载,适用于印章注释类型(Dynamic/Sign/StandardBusiness);UpdateMeasurementSettingsAsync(references),用于更新现有测量注释的测量设置。可用于在不操作工具栏的情况下以编程方式切换注释模式、实现自定义注释工具栏,以及自动执行注释工作流。 |
| annotation-selector-settings.md | 通过 PdfViewerAnnotationSelectorSettings 配置全局注释选择器外观。属性(共 9 个):ResizerBorderColor(缩放手柄边框)、ResizerCursorType、ResizerFillColor(缩放手柄填充)、ResizerLocation、ResizerShape(AnnotationResizerShape:Square/Circle)、ResizerSize(手柄大小,单位为 px)、SelectionBorderColor(选区轮廓颜色)、SelectionBorderThickness(选区边框宽度 1–10,默认值为 1)、SelectorLineDashArray(虚线样式 double[])。与 PdfViewerAnnotationSelectorSettings 标记配合使用,可统一设置所有注释类型的选择器样式。 |
| area-annotation-settings.md | 通过 PdfViewerAreaSettings 配置面积注释的默认外观和行为。属性(共 17 个):AllowedInteractions、Author、CustomData、IsLock、IsPrint、MaxHeight、MaxWidth、MinHeight、MinWidth、SkipDownload、SkipPrint、AnnotationSelectorSettings、BorderDashArray、FillColor、Opacity、StrokeColor、Thickness。可用于设置面积注释的默认外观、尺寸限制、锁定行为,以及是否包含在打印/下载内容中。 |
| arrow-annotation-settings.md | 通过 PdfViewerArrowSettings 配置箭头注释的默认外观和行为。属性(共 19 个):AllowedInteractions、Author、CustomData、IsLock、IsPrint、MaxHeight、MaxWidth、MinHeight、MinWidth、SkipDownload、SkipPrint、AnnotationSelectorSettings、BorderDashArray、FillColor、Opacity、StrokeColor、Thickness、LineHeadEndStyle、LineHeadStartStyle。可用于配置箭头注释的默认样式,包括两端的箭头样式。 |
| circle-annotation-settings.md | 通过 PdfViewerCircleSettings 配置圆形注释的默认外观和行为。属性(共 17 个):AllowedInteractions、Author、CustomData、IsLock、IsPrint、MaxHeight、MaxWidth、MinHeight、MinWidth、SkipDownload、SkipPrint、AnnotationSelectorSettings、BorderDashArray、FillColor、Opacity、StrokeColor、Thickness。可用于设置圆形注释的默认外观、尺寸限制、锁定行为,以及是否包含在打印/下载内容中。 |
| command-panel.md | PDF Viewer 的批注面板可见性和行为配置。属性(共 3 个):EnableCommentPanel(bool——启用/禁用批注面板功能)、CommentPanelVisible(bool,默认值为 false——显示/隐藏面板 UI)、CommentPanelVisibleChanged(EventCallback——双向绑定回调)。CommentPanelSettings:Multiline(bool,默认值为 false——启用多行文本框)、DateTimeFormat(string——自定义时间戳格式)。可用于控制批注面板的可用性和可见状态,以及注释审阅工作流中的批注输入体验。 |
| custom-stamp-annotation-settings.md | 通过 PdfViewerCustomStampSettings 配置自定义印章/图像注释的默认外观和行为。属性(共 21 个):AllowedInteractions、Author、CustomData、IsLock、IsPrint、MaxHeight、MaxWidth、MinHeight、MinWidth、SkipDownload、SkipPrint、AnnotationSelectorSettings、BorderDashArray、FillColor、Opacity、StrokeColor、Thickness、Height、Width、CustomStamps(包含 CustomStampName 和 CustomStampImageSource 的 List)、EnableCustomStamp(bool,默认值为 true)、IsAddToMenu(bool——将新印章保留在菜单中)。可用于配置自定义图像印章并管理印章菜单集合。 |
| distance-annotation-settings.md | 通过 PdfViewerDistanceSettings 配置距离测量注释的默认外观和行为。属性(共 20 个):AllowedInteractions、Author、CustomData、IsLock、IsPrint、MaxHeight、MaxWidth、MinHeight、MinWidth、SkipDownload、SkipPrint、AnnotationSelectorSettings、BorderDashArray、FillColor、Opacity、StrokeColor、Thickness、LineHeadEndStyle、LineHeadStartStyle、LeaderLength。可用于配置距离测量注释的默认设置,包括线端样式和引线长度。 |
| free-text-annotation-settings.md | 通过 PdfViewerFreeTextSettings 配置自由文本注释的默认外观和行为。属性(共 27 个):AllowedInteractions、Author、CustomData、IsLock、IsPrint、MaxHeight、MaxWidth、MinHeight、MinWidth、SkipDownload、SkipPrint、AnnotationSelectorSettings、Opacity、Height、Width、AllowEditTextOnly(bool——仅允许编辑文本)、AutoFit(bool——根据内容自动调整大小)、BorderColor、BorderStyle、BorderThickness、DefaultText、FillColor、FontColor、FontFamily、FontSize(int,默认值为 16)、FontStyle、TextAlignment。可用于全面自定义自由文本注释的默认外观和编辑行为。 |
| handwritten-signature-settings.md | 通过 PdfViewerHandwrittenSignatureSettings 配置手写签名注释的默认外观和行为。属性(共 19 个):AllowedInteractions、Author、CustomData、IsLock、IsPrint、MaxHeight、MaxWidth、MinHeight、MinWidth、SkipDownload、SkipPrint、AnnotationSelectorSettings、BorderDashArray、FillColor、Opacity、StrokeColor、Thickness、Height、Width、SignatureDialogSettings(包含 DisplayMode、HideSaveSignature、SignatureFonts 的 PdfViewerSignatureDialogSettings)。可用于配置手写签名的默认设置,包括签名采集对话框选项。 |
| highlight-annotation-settings.md | 通过 PdfViewerHighlightSettings 配置高亮注释的默认外观和行为。属性(共 11 个):AllowedInteractions、Author、CustomData、IsLock、IsPrint、MaxHeight、MaxWidth、MinHeight、MinWidth、SkipDownload、SkipPrint、Opacity、Color、EnableMultiPageAnnotation(bool——允许跨页高亮)、EnableTextMarkupResizer(bool——显示缩放手柄)。可用于设置高亮注释的默认值,包括跨页支持和缩放手柄可见性。 |
| ink-annotation-settings.md | 通过 PdfViewerInkAnnotationSettings 配置墨迹注释的默认外观和行为。属性(共 18 个):AllowedInteractions、Author、CustomData、IsLock、IsPrint、MaxHeight、MaxWidth、MinHeight、MinWidth、SkipDownload、SkipPrint、AnnotationSelectorSettings、BorderDashArray、FillColor、Opacity、StrokeColor、Thickness、Height、Width。可用于配置墨迹/手绘注释的默认外观和尺寸限制。 |
| line-annotation-settings.md | 通过 PdfViewerLineSettings 配置线条注释的默认外观和行为。属性(共 19 个):AllowedInteractions、Author、CustomData、IsLock、IsPrint、MaxHeight、MaxWidth、MinHeight、MinWidth、SkipDownload、SkipPrint、AnnotationSelectorSettings、BorderDashArray、FillColor、Opacity、StrokeColor、Thickness、LineHeadEndStyle、LineHeadStartStyle。可用于配置线条注释的默认样式,包括可配置的起点和终点线头样式。 |
| measurement-annotations-settings.md | 通过 PdfViewerMeasurementSettings 配置所有测量注释的全局测量单位和比例。属性(共 4 个):ConversionUnit(CalibrationUnit 枚举)、Depth(int)、DisplayUnit(CalibrationUnit 枚举)、ScaleRatio(double——显示时与实际测量值相乘的系数)。可用于为所有距离、周长、面积、半径和体积测量注释设置统一的测量单位和比例。 |
| navigation-toolbar-settings.md | 左侧导航 UI 的导航工具栏和面板配置。相关属性:EnableNavigationToolbar(bool——显示/隐藏左侧导航工具栏)、EnableNavigationPanel(bool——启用支持自定义项目的现代导航面板)。NavigationToolbarSettings:BuiltInItems(List:Thumbnails、Bookmarks、CommentPanel、PageOrganizer)、CustomItems(List,包含 Name、HeaderText、IconCss、Index、TooltipText、ItemType、Template,用于提供 RenderFragment 面板内容)。可用于自定义显示的导航面板,并注入包含交互内容的完全自定义面板模板。 |
| perimeter-annotation-settings.md | 通过 PdfViewerPerimeterSettings 配置周长测量注释的默认外观和行为。属性(共 17 个):AllowedInteractions、Author、CustomData、IsLock、IsPrint、MaxHeight、MaxWidth、MinHeight、MinWidth、SkipDownload、SkipPrint、AnnotationSelectorSettings、BorderDashArray、FillColor、Opacity、StrokeColor、Thickness。可用于设置周长测量注释的默认外观、尺寸限制和交互限制。 |
| polygon-annotation-settings.md | 通过 PdfViewerPolygonSettings 配置多边形注释的默认外观和行为。属性(共 17 个):AllowedInteractions、Author、CustomData、IsLock、IsPrint、MaxHeight、MaxWidth、MinHeight、MinWidth、SkipDownload、SkipPrint、AnnotationSelectorSettings、BorderDashArray、FillColor、Opacity、StrokeColor、Thickness。可用于设置多边形注释的默认外观、尺寸限制、锁定行为,以及是否包含在打印/下载内容中。 |
| radius-annotation-settings.md | 通过 PdfViewerRadiusSettings 配置半径测量注释的默认外观和行为。属性(共 17 个):AllowedInteractions、Author、CustomData、IsLock、IsPrint、MaxHeight、MaxWidth、MinHeight、MinWidth、SkipDownload、SkipPrint、AnnotationSelectorSettings、BorderDashArray、FillColor、Opacity、StrokeColor、Thickness。可用于设置半径测量注释的默认外观、尺寸限制和交互限制。 |
| rectangle-annotation-settings.md | 通过 PdfViewerRectangleSettings 配置矩形注释的默认外观和行为。属性(共 17 个):AllowedInteractions、Author、CustomData、IsLock、IsPrint、MaxHeight、MaxWidth、MinHeight、MinWidth、SkipDownload、SkipPrint、AnnotationSelectorSettings、BorderDashArray、FillColor、Opacity、StrokeColor、Thickness。可用于设置矩形注释的默认外观、尺寸限制、锁定行为,以及是否包含在打印/下载内容中。 |
| signature-annotation-events.md | 手写签名注释专用的生命周期和交互事件(共 7 个事件)。事件:AddSignature(Bound、Opacity、StrokeColor、Thickness、Id、PageNumber)、MoveSignature(CurrentPosition、PreviousPosition、Opacity、StrokeColor、Thickness、Id、PageNumber)、RemoveSignature(Bound、Id、PageNumber)、ResizeSignature(CurrentPosition、PreviousPosition、Opacity、StrokeColor、Thickness、Id、PageNumber)、SignaturePropertiesChange(IsOpacityChanged、IsStrokeColorChanged、IsThicknessChanged、NewValue、OldValue、Id、PageNumber)、SignatureSelected(Id、PageNumber)、SignatureUnselected(Id、PageNumber)。可用于跟踪签名生命周期、验证更改,并将签名状态与应用数据同步。 |
| squiggly-annotation-settings.md | 通过 PdfViewerSquigglySettings 配置波浪线注释的默认外观和行为。属性(共 11 个):AllowedInteractions、Author、CustomData、IsLock、IsPrint、MaxHeight、MaxWidth、MinHeight、MinWidth、SkipDownload、SkipPrint、Opacity、Color(波浪线颜色)、EnableMultiPageAnnotation(bool)、EnableTextMarkupResizer(bool)。可用于设置波浪线文本标记注释的默认值,包括跨页支持和缩放手柄可见性。 |
| stamp-annotation-settings.md | 通过 PdfViewerStampSettings 配置印章/图像注释的默认外观和行为。属性(共 22 个):AllowedInteractions、Author、CustomData、IsLock、IsPrint、MaxHeight、MaxWidth、MinHeight、MinWidth、SkipDownload、SkipPrint、AnnotationSelectorSettings、BorderDashArray、FillColor、Opacity、StrokeColor、Thickness、Height、Width、DateTimeFormat(动态印章的自定义日期/时间格式)、DynamicStamps(List)、SignStamps(List)、StandardBusinessStamps(List)。可用于配置注释工具栏中显示的内置印章类型,并自定义印章默认设置。 |
| stickynotes-annotation-settings.md | 通过 PdfViewerStickyNotesSettings 配置便笺注释的默认外观和行为。属性(共 11 个):AllowedInteractions、Author、CustomData、IsLock、IsPrint、MaxHeight、MaxWidth、MinHeight、MinWidth、SkipDownload、SkipPrint、Opacity。可用于设置便笺注释的默认值,包括交互限制、尺寸限制和打印/下载行为。 |
| strikethrough-annotation-settings.md | 通过 PdfViewerStrikethroughSettings 配置删除线注释的默认外观和行为。属性(共 11 个):AllowedInteractions、Author、CustomData、IsLock、IsPrint、MaxHeight、MaxWidth、MinHeight、MinWidth、SkipDownload、SkipPrint、Opacity、Color(删除线颜色)、EnableMultiPageAnnotation(bool)、EnableTextMarkupResizer(bool)。可用于设置删除线文本标记注释的默认值,包括跨页支持和缩放手柄可见性。 |
| text-selection-and-extraction.md | 介绍通过 EnableTextSelection、IsExtractText 启用或禁用属性实现文本选择和文本提取的功能;通过 ClearTextSelectionAsync、SelectTextRegionAsync 方法以编程方式选择文本;通过 OnTextSelectionEnd、OnTextSelectionStart、ExtractTextCompleted 事件跟踪处理过程。 |
| tile-rendering.md | 通过 PdfViewerTileRenderingSettings 配置平铺渲染以优化性能。属性(共 3 个):EnableTileRendering(bool——启用/禁用基于平铺的渲染)、X(int——水平平铺坐标数)、Y(int——垂直平铺坐标数)。可对大型或复杂 PDF 启用平铺渲染,将页面拆分为多个平铺,以提升渲染性能。 |
| underline-annotation-settings.md | 通过 PdfViewerUnderlineSettings 配置下划线注释的默认外观和行为。属性(共 11 个):AllowedInteractions、Author、CustomData、IsLock、IsPrint、MaxHeight、MaxWidth、MinHeight、MinWidth、SkipDownload、SkipPrint、Opacity(0–1)、Color(下划线颜色)、EnableMultiPageAnnotation(bool)、EnableTextMarkupResizer(bool)。可用于设置下划线文本标记注释的默认值,包括跨页支持和缩放手柄可见性。 |
| volume-annotation-settings.md | 通过 PdfViewerVolumeSettings 配置体积测量注释的默认外观和行为。属性(共 17 个):AllowedInteractions、Author、CustomData、IsLock、IsPrint、MaxHeight、MaxWidth、MinHeight、MinWidth、SkipDownload、SkipPrint、AnnotationSelectorSettings、BorderDashArray、FillColor、Opacity、StrokeColor、Thickness。可用于设置体积测量注释的默认外观、尺寸限制和交互限制。 |
| azure-container-deployment.md | 使用 Docker 容器、Azure Container Registry (ACR) 和 Azure App Service 将 Blazor PDF Viewer 应用部署到 Azure 的全面指南。涵盖先决条件、Server 和 WebAssembly 模式的 Dockerfile 配置、本机依赖项要求(libgdiplus)、本地 Docker 构建/测试命令、ACR 设置和镜像推送步骤、Azure App Service 创建和容器配置、常见部署问题的故障排除指南,以及生产部署最佳实践。适用于提供部署指导、回答 Azure 容器问题,或说明 PDF Viewer 应用的 Docker 容器化。 |
| annotation-enum-properties.md | 注释类型的枚举定义。用于提供注释通用属性的类和枚举属性。 |
| annotation-general-enum-properties.md | 通用注释枚举属性。用于提供注释方法的类和枚举属性(例如,Bound 类型)。 |
| annotation-settings-enum-properties.md | 注释设置的枚举属性。用于提供注释设置属性的类和枚举属性。 |
| form-fields-enum-properties.md | 表单字段的枚举属性。用于提供表单字段相关属性的类和枚举属性。 |
| general-enum-properties.md | 通用枚举(InteractionMode、ZoomMode、ContextMenuAction 等)。用于提供通用属性的类和枚举属性。 |
| keyboard-enum-properties.md | 键盘快捷键的枚举属性。用于提供键盘操作的类和枚举属性。 |
| pdf-annotation-enum-properties.md | PDF 专用注释枚举(例如,AllowedInteraction)。用于提供注释的类和枚举属性。 |
| toolbar-enum-properties.md | 工具栏项目枚举(ToolbarItem、AnnotationToolbarItem 等)。用于提供工具栏属性的类和枚举属性。 |
Quick Start Example
@page "/pdfviewer-sample"
@using Syncfusion.Blazor
@using Syncfusion.Blazor.SfPdfViewer
@using Syncfusion.Blazor.Buttons
<SfPdfViewer2 @ref="_pdfviewer"
DocumentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
Height="100%"
Width="100%">
</SfPdfViewer2>
@code {
private SfPdfViewer2 _pdfviewer { get; set; }
}