Skip to content

feat(PdfReader): add OnGetStreamAsync parameter#7300

Merged
ArgoZhang merged 2 commits intomainfrom
feat-pdf
Dec 12, 2025
Merged

feat(PdfReader): add OnGetStreamAsync parameter#7300
ArgoZhang merged 2 commits intomainfrom
feat-pdf

Conversation

@ArgoZhang
Copy link
Copy Markdown
Member

@ArgoZhang ArgoZhang commented Dec 12, 2025

Link issues

fixes #7298

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Update server project, including resource localization files, to support the new PdfReader OnGetStreamAsync parameter.

New Features:

  • Introduce support in the server project for configuring the PdfReader OnGetStreamAsync callback.

Enhancements:

  • Adjust localization resources in both English and Chinese to reflect the new PdfReader functionality.

Copilot AI review requested due to automatic review settings December 12, 2025 02:09
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Dec 12, 2025

🧙 Sourcery has finished reviewing your pull request!


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@bb-auto bb-auto bot added the enhancement New feature or request label Dec 12, 2025
@bb-auto bb-auto bot added this to the v10.1.0 milestone Dec 12, 2025
@ArgoZhang ArgoZhang merged commit af8fef4 into main Dec 12, 2025
7 of 8 checks passed
@ArgoZhang ArgoZhang deleted the feat-pdf branch December 12, 2025 02:09
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes - here's some feedback:

  • Ensure any new localization keys added for the PdfReader OnGetStreamAsync support are kept consistent (same keys, only value differences) between en-US.json and zh-CN.json to avoid runtime lookup issues.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Ensure any new localization keys added for the PdfReader OnGetStreamAsync support are kept consistent (same keys, only value differences) between en-US.json and zh-CN.json to avoid runtime lookup issues.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds the OnGetStreamAsync parameter to the PdfReader component, providing developers with a new way to specify file streams for PDF rendering. The changes update documentation strings and bump the package version to reflect this new feature.

  • Updated documentation to reflect the parameter name change from Filename/Stream to Url/OnGetStreamAsync
  • Modified both Chinese and English localization strings to describe the new parameter usage
  • Bumped BootstrapBlazor.PdfReader package version from 10.0.11 to 10.0.12

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/BootstrapBlazor.Server/Locales/zh-CN.json Updated Chinese documentation text to describe the new OnGetStreamAsync parameter and Url parameter usage
src/BootstrapBlazor.Server/Locales/en-US.json Updated English documentation text to describe the new OnGetStreamAsync parameter and Url parameter usage
src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj Bumped BootstrapBlazor.PdfReader package version to 10.0.12 to include the new feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"PdfIntro": "Embed and display PDF documents directly in web pages without relying on a PDF reader installed locally by the user.",
"PdfReaderNormalText": "Basic usage",
"PdfReaderNormalIntro": "Use Filename parameter displays pdf file from local server, or Stream parameter use file stream for rendering",
"PdfReaderNormalIntro": "Set the PDF file address using the <code>Url</code> parameter, or specify the file stream to be rendered using the <code>OnGetStreamAsync</code> parameter.",
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For better parallel structure and conciseness, change "the file stream to be rendered" to "the file stream for rendering" to match the style of the first clause.

Suggested change
"PdfReaderNormalIntro": "Set the PDF file address using the <code>Url</code> parameter, or specify the file stream to be rendered using the <code>OnGetStreamAsync</code> parameter.",
"PdfReaderNormalIntro": "Set the PDF file address using the <code>Url</code> parameter, or specify the file stream for rendering using the <code>OnGetStreamAsync</code> parameter.",

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (19c6e27) to head (f360758).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7300   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          745       745           
  Lines        32629     32629           
  Branches      4520      4520           
=========================================
  Hits         32629     32629           
Flag Coverage Δ
BB 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(PdfReader): Load data from Stream or ByteArray

2 participants