diff --git a/src/BootstrapBlazor.Server/Components/Samples/Html2Pdfs.razor b/src/BootstrapBlazor.Server/Components/Samples/Html2Pdfs.razor index cf0303cd6fe..34a1cf888b3 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Html2Pdfs.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/Html2Pdfs.razor @@ -29,11 +29,10 @@
@((MarkupString)Localizer["Html2PdfStep1"].Value)
services.AddBootstrapBlazorHtml2PdfService();-
常见问题
+@Localizer["CommonIssuesTitle"]
-1. 本地或者发布后无法使用
-BootstrapBlazor.Html2Pdf v9.0.3 后增加了日志输出功能,可以根据日志判断具体问题出现在哪里。比如由于根据当前浏览器版本去下载对应版本的
- chrome-headless-shell-win64.zip 安装包
@Localizer["Issue1Title"]
+@((MarkupString)Localizer["Issue1Answer"].Value)
info: BootstrapBlazor.Components.DefaultPdfService[0]
Ready to start downloading browser
info: BootstrapBlazor.Components.DefaultPdfService[0]
@@ -41,33 +40,33 @@ info: BootstrapBlazor.Components.DefaultPdfService[0]
info: BootstrapBlazor.Components.DefaultPdfService[0]
Start your browser | Args: --no-sandbox, --disable-setuid-sandbox, --disable-web-security
-2. 如何手动安装 Debian Linux 系统的 Chrome 浏览器
@((MarkupString)Localizer["Issue2Title"].Value)
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo apt install ./google-chrome-stable_current_amd64.deb-
3. 如何检查 Debian Linux 系统 Chrome 依赖缺失
@((MarkupString)Localizer["Issue3Title"].Value)
通过下面命令检查依赖缺失情况
+@Localizer["Issue3CommandIntro"]
ldd chrome | grep not-
4. 部署后是否会反复下载 Chrome 安装包
-不会,Html2Pdf 会检查是否存在安装目录安装成功后即不会重复下载安装操作
+@Localizer["Issue4Title"]
+@Localizer["Issue4Answer"]
可以通过 PdfOptions 配置类设置导出 Pdf 一些相关设置
@((MarkupString)Localizer["PdfOptionsIntro"].Value)
Landscape 是否横向打印 默认 falsePrintBackground 是否打印背景色 默认 falseFormat 纸张格式 默认 A4DisplayHeaderFooter 是否显示页眉页脚 默认 falseScale 放大比例 默认 1 取值 0.1 到 2 之间MarginOptions 页面边距 默认 noneId element content as Pdf by setting ExportPdfButton component parameter ElementId",
"ExportPdfButtonTitle": "ExportPdfButton",
@@ -2581,7 +2582,24 @@
"Html2PdfNote": "If you export too much content, signalR communication interruption may be triggered. Please adjust the HubOptions configuration.",
"Html2PdfStep1": "Inject Service",
"Html2PdfTitle": "Html export to Pdf",
+ "Issue1Answer": "Since BootstrapBlazor.Html2Pdf v9.0.3, logging output has been added, and you can determine where the specific problem occurs from the logs. For example, it may be downloading the matching chrome-headless-shell-win64.zip package based on the current browser version.",
+ "Issue1Title": "1. It cannot be used locally or after deployment",
+ "Issue2Title": "2. How to manually install the Chrome browser on Debian Linux",
+ "Issue3CommandIntro": "Use the following command to check for missing dependencies",
+ "Issue3Item1": "Check whether the server can connect to the Chrome download server",
+ "Issue3Item2": "Check whether the server has permission to execute the installation package",
+ "Issue3Item3": "Check whether any dependencies are missing",
+ "Issue3Title": "3. How to check missing Chrome dependencies on Debian Linux",
+ "Issue4Answer": "No. Html2Pdf checks whether the installation directory already exists, and after a successful installation it will not repeatedly download and install the package.",
+ "Issue4Title": "4. Will the Chrome installation package be downloaded repeatedly after deployment?",
"PackageIntro": "Component default not implemented IHtml2Pdf, please refer to the package BootstrapBlazor.Html2Pdf package",
+ "PdfOptionsIntro": "You can configure related export settings for Pdf through the PdfOptions configuration class",
+ "PdfOptionsItem1": "Landscape whether to print in landscape mode, default is false",
+ "PdfOptionsItem2": "PrintBackground whether to print background colors, default is false",
+ "PdfOptionsItem3": "Format paper format, default is A4",
+ "PdfOptionsItem4": "DisplayHeaderFooter whether to display headers and footers, default is false",
+ "PdfOptionsItem5": "Scale zoom ratio, default is 1, range is between 0.1 and 2",
+ "PdfOptionsItem6": "MarginOptions page margins, default is none",
"Tips1": "Introduce",
"Tips2": "service",
"ToastContent": "Export table by id to pdf success.",
diff --git a/src/BootstrapBlazor.Server/Locales/zh-CN.json b/src/BootstrapBlazor.Server/Locales/zh-CN.json
index 3e5f7231043..20ccf0169b4 100644
--- a/src/BootstrapBlazor.Server/Locales/zh-CN.json
+++ b/src/BootstrapBlazor.Server/Locales/zh-CN.json
@@ -2567,6 +2567,7 @@
"Html2ImageTitle": "Html2Image 网页元素转成图片服务"
},
"BootstrapBlazor.Server.Components.Samples.Html2Pdfs": {
+ "CommonIssuesTitle": "常见问题",
"ExportButtonText": "导出 Pdf",
"ExportPdfButtonIntro": "通过设置 ExportPdfButton 组件参数 ElementId 将指定 Id 元素内容导出为 Pdf",
"ExportPdfButtonTitle": "使用 ExportPdfButton 导出按钮",
@@ -2581,7 +2582,24 @@
"Html2PdfNote": "如果导出内容过多,可能会触发 signalR 通讯中断问题,请自行调整 HubOptions 配置即可。",
"Html2PdfStep1": "注入服务",
"Html2PdfTitle": "Html 导出为 Pdf",
+ "Issue1Answer": "BootstrapBlazor.Html2Pdf v9.0.3 后增加了日志输出功能,可以根据日志判断具体问题出现在哪里。比如由于根据当前浏览器版本去下载对应版本的 chrome-headless-shell-win64.zip 安装包",
+ "Issue1Title": "1. 本地或者发布后无法使用",
+ "Issue2Title": "2. 如何手动安装 Debian Linux 系统的 Chrome 浏览器",
+ "Issue3CommandIntro": "通过下面命令检查依赖缺失情况",
+ "Issue3Item1": "检查是否可以连接到 Chrome 服务器",
+ "Issue3Item2": "检查服务器是否有执行安装包权限",
+ "Issue3Item3": "检查是否有依赖缺失",
+ "Issue3Title": "3. 如何检查 Debian Linux 系统 Chrome 依赖缺失",
+ "Issue4Answer": "不会,Html2Pdf 会检查是否存在安装目录安装成功后即不会重复下载安装操作",
+ "Issue4Title": "4. 部署后是否会反复下载 Chrome 安装包",
"PackageIntro": "组件默认未实现 IHtml2Pdf,请通过引用包 BootstrapBlazor.Html2Pdf 实现",
+ "PdfOptionsIntro": "可以通过 PdfOptions 配置类设置导出 Pdf 一些相关设置",
+ "PdfOptionsItem1": "Landscape 是否横向打印 默认 false",
+ "PdfOptionsItem2": "PrintBackground 是否打印背景色 默认 false",
+ "PdfOptionsItem3": "Format 纸张格式 默认 A4",
+ "PdfOptionsItem4": "DisplayHeaderFooter 是否显示页眉页脚 默认 false",
+ "PdfOptionsItem5": "Scale 放大比例 默认 1 取值 0.1 到 2 之间",
+ "PdfOptionsItem6": "MarginOptions 页面边距 默认 none",
"Tips1": "实现原理",
"Tips2": "服务",
"ToastContent": "通过表格 Id 导出 Pdf 文件成功",