Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds documentation and localization-supported UI hints to the PdfReader sample demonstrating font-awesome integration and new stream/filename-related PdfReader features, with corresponding locale entries and project updates. Flow diagram for rendering localized PdfReader sample hintsflowchart TD
A_UserOp[User opens PdfReaders_sample_page] --> B_Locale[Determine_current_locale]
B_Locale --> C_LoadStrings[Load_localized_strings_from_en_US_or_zh_CN]
C_LoadStrings --> D_RenderIntro[Render_PdfReader_normal_intro]
D_RenderIntro --> E_RenderFA[Render_font_awesome_description_as_MarkupString]
E_RenderFA --> F_ShowLink[Show_FA_stylesheet_link_snippet]
F_ShowLink --> G_RenderList[Render_UL_with_stream_and_filename_descriptions]
G_RenderList --> H_UserReads[User_reads_hints_on_stream_and_download_filename_features]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `src/BootstrapBlazor.Server/Components/Samples/PdfReaders.razor:10-14` </location>
<code_context>
<PackageTips Name="BootstrapBlazor.PdfReader" />
<DemoBlock Title="@Localizer["PdfReaderNormalText"]" Introduction="@Localizer["PdfReaderNormalIntro"]" Name="Normal">
+ <p>@((MarkupString)Localizer["PdfReaderFAIconDesc"].Value)</p>
+ <Pre><link rel="stylesheet" href="@@Assets["_content/BootstrapBlazor.FontAwesome/css/font-awesome.min.css"]" /></Pre>
+ <ul class="ul-demo">
+ <li>@((MarkupString)Localizer["PdfReaderSetPdfStreamDesc"].Value)</li>
+ <li>@((MarkupString)Localizer["PdfReaderDownloadFileNameDesc"].Value)</li>
+ </ul>
<section ignore class="row form-inline g-3" style="--bb-input-group-label-width: 176px;">
</code_context>
<issue_to_address>
**🚨 issue (security):** Casting localized strings to MarkupString can introduce XSS risk if the content is not fully trusted or strictly controlled.
These casts mean any HTML in the resource strings will be rendered directly. If the resources can ever be influenced by user input or external systems, this becomes an XSS vector. If they’re guaranteed to be static, controlled strings shipped with the app, it’s safer to explicitly whitelist which keys may contain HTML or wrap this in a helper (e.g., `Localizer.AsHtml("key")`) so HTML rendering is centralized and harder to misuse elsewhere.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
# Conflicts: # src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj
The merge-base changed after approval.
There was a problem hiding this comment.
Pull request overview
This PR adds stream support for the print PDF function in the PdfReader component, fixing issue #7360. The changes primarily focus on documentation and localization updates to inform users about new streaming capabilities.
- Adds localization strings documenting FontAwesome dependency, streaming methods (SetPdfStreamAsync/SetPdfBase64DataAsync), and DownloadFileName parameter
- Updates PdfReaders.razor demo page with enhanced documentation showing how to use the streaming features
- Updates BootstrapBlazor.PdfReader package from version 10.0.18 to 10.0.21
Reviewed changes
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/BootstrapBlazor.Server/Locales/zh-CN.json | Adds Chinese localization for PdfReader FontAwesome dependency, streaming methods, and download filename configuration |
| src/BootstrapBlazor.Server/Locales/en-US.json | Adds English localization for PdfReader FontAwesome dependency, streaming methods, and download filename configuration |
| src/BootstrapBlazor.Server/Components/Samples/PdfReaders.razor | Enhances demo page documentation with FontAwesome reference instructions and feature descriptions for streaming and download functionality |
| src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj | Updates BootstrapBlazor.PdfReader package version to 10.0.21 to support new streaming features |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7361 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 747 747
Lines 32760 32760
Branches 4540 4540
=========================================
Hits 32760 32760
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Link issues
fixes #7360
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Enhance the PdfReader sample to document and demonstrate new stream-based printing capabilities and related configuration options.
New Features:
Enhancements: