File tree Expand file tree Collapse file tree 1 file changed +1
-17
lines changed
src/BootstrapBlazor/Components/Button Expand file tree Collapse file tree 1 file changed +1
-17
lines changed Original file line number Diff line number Diff line change @@ -67,9 +67,6 @@ public class ExportPdfButton : Button
6767 [ Inject , NotNull ]
6868 private IHtml2Pdf ? Html2PdfService { get ; set ; }
6969
70- [ Inject , NotNull ]
71- private NavigationManager ? NavigationManager { get ; set ; }
72-
7370 [ Inject , NotNull ]
7471 private DownloadService ? DownloadService { get ; set ; }
7572
@@ -117,21 +114,8 @@ protected override async Task HandlerClick()
117114 </html>
118115 """ ;
119116
120- // 增加网页所需样式表文件
121- List < string > styles = [
122- $ "{ NavigationManager . BaseUri } _content/BootstrapBlazor.FontAwesome/css/font-awesome.min.css",
123- $ "{ NavigationManager . BaseUri } _content/BootstrapBlazor/css/bootstrap.blazor.bundle.min.css"
124- ] ;
125- if ( StyleTags != null )
126- {
127- styles . AddRange ( StyleTags ) ;
128- }
129-
130- // 增加网页所需脚本文件
131- var scripts = ScriptTags ?? [ ] ;
132-
133117 // 生成 Pdf 流
134- using var stream = await Html2PdfService . PdfStreamFromHtmlAsync ( htmlString , styles , scripts ) ;
118+ using var stream = await Html2PdfService . PdfStreamFromHtmlAsync ( htmlString , StyleTags , ScriptTags ) ;
135119
136120 if ( OnBeforeDownload != null )
137121 {
You can’t perform that action at this time.
0 commit comments