Skip to content

Conversation

@ArgoZhang
Copy link
Member

@ArgoZhang ArgoZhang commented Oct 31, 2025

Link issues

fixes #7037

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

Add documentation for PdfOptions in HTML2PDF sample and clarify the default margin description

Documentation:

  • Add a Tips section in Html2Pdfs.razor outlining PdfOptions properties and their default values
  • Update PdfOptions’ XML comment to clarify that margins default to unset

Copilot AI review requested due to automatic review settings October 31, 2025 00:48
@bb-auto bb-auto bot added the documentation Improvements or additions to documentation label Oct 31, 2025
@bb-auto bb-auto bot added this to the 9.11.0 milestone Oct 31, 2025
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 31, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The PR enhances the Html2Pdf sample by adding detailed documentation for the PdfOptions configuration and corrects the default description for MarginOptions in the PdfOptions class.

Class diagram for updated PdfOptions documentation

classDiagram
class PdfOptions {
  bool Landscape
  bool PrintBackground
  string Format
  bool DisplayHeaderFooter
  decimal Scale
  MarginOptions MarginOptions
}
class MarginOptions
PdfOptions --> MarginOptions
Loading

File-Level Changes

Change Details Files
Added PdfOptions documentation in sample page
  • Inserted paragraph introducing PdfOptions usage
  • Added Tips block listing Landscape, PrintBackground, Format, DisplayHeaderFooter, Scale and MarginOptions
src/BootstrapBlazor.Server/Components/Samples/Html2Pdfs.razor
Refined default MarginOptions description
  • Updated XML comment default text from 'none' to '未设置'
src/BootstrapBlazor/Options/PdfOptions.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#7037 Add documentation for PdfOptions, describing its configuration options and usage.

Possibly linked issues


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

@ArgoZhang ArgoZhang merged commit 7652927 into main Oct 31, 2025
8 of 9 checks passed
@ArgoZhang ArgoZhang deleted the doc-pdf branch October 31, 2025 00:48
Copy link
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 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/Html2Pdfs.razor:52-54` </location>
<code_context>

+<p>通过下面命令检查依赖缺失情况</p>
+
+<Pre>ldd chrome | grep not</Pre>
+
 <p class="code-quest">4. 部署后是否会反复下载 Chrome 安装包</p>
</code_context>

<issue_to_address>
**suggestion:** Consider clarifying the 'chrome' binary path for ldd command.

Specifying the full path to the 'chrome' binary (e.g., '/usr/bin/google-chrome-stable') will help users locate it and ensure the command works reliably.

```suggestion
<p>通过下面命令检查依赖缺失情况(请根据实际安装路径调整 chrome 二进制文件路径)</p>

<Pre>ldd /usr/bin/google-chrome-stable | grep not</Pre>
```
</issue_to_address>

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.

Comment on lines +52 to +54
<p>通过下面命令检查依赖缺失情况</p>

<Pre>ldd chrome | grep not</Pre>
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Consider clarifying the 'chrome' binary path for ldd command.

Specifying the full path to the 'chrome' binary (e.g., '/usr/bin/google-chrome-stable') will help users locate it and ensure the command works reliably.

Suggested change
<p>通过下面命令检查依赖缺失情况</p>
<Pre>ldd chrome | grep not</Pre>
<p>通过下面命令检查依赖缺失情况(请根据实际安装路径调整 chrome 二进制文件路径)</p>
<Pre>ldd /usr/bin/google-chrome-stable | grep not</Pre>

@codecov
Copy link

codecov bot commented Oct 31, 2025

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7038   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          743       743           
  Lines        32475     32475           
  Branches      4500      4500           
=========================================
  Hits         32475     32475           
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.

Copy link
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 PR updates version numbers and improves documentation for PDF export functionality. The comment describing the default value for MarginOptions is clarified from "none" to "not set" to better reflect that margin properties default to null values.

  • Updated project version numbers for VS 17.0 and VS 18.0
  • Clarified documentation for MarginOptions default value
  • Added comprehensive PdfOptions configuration documentation to the Html2Pdfs sample page

Reviewed Changes

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

File Description
src/BootstrapBlazor/BootstrapBlazor.csproj Version bumps for both Visual Studio 17.0 (9.12.0) and 18.0 (10.0.0-rc.2.2.0) configurations
src/BootstrapBlazor/Options/PdfOptions.cs Updated Chinese comment to clarify MarginOptions defaults to "not set" instead of "none"
src/BootstrapBlazor.Server/Components/Samples/Html2Pdfs.razor Added Tips section documenting PdfOptions configuration properties and added command for checking Chrome dependency issues

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

<li><code>Format</code> 纸张格式 默认 A4</li>
<li><code>DisplayHeaderFooter</code> 是否显示页眉页脚 默认 false</li>
<li><code>Scale</code> 放大比例 默认 1 取值 0.12 之间</li>
<li><code>MarginOptions</code> 页面边距 默认 none</li>
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

The documentation still says '默认 none' (default none) but the code comment in PdfOptions.cs was updated to '默认 未设置' (default not set). These should be consistent. Update this line to match the corrected description: '默认 未设置'.

Suggested change
<li><code>MarginOptions</code> 页面边距 默认 none</li>
<li><code>MarginOptions</code> 页面边距 默认 未设置</li>

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doc(Html2Pdf): add PdfOptions documentation

2 participants