File tree Expand file tree Collapse file tree
src/components/BootstrapBlazor.PdfReader Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ public partial class PdfReader
141141 private string ? _dropdownItemDefaultIcon ;
142142 private bool _enableThumbnails = true ;
143143 private bool _showToolbar = true ;
144+ private PdfReaderFitMode _fitMode ;
144145
145146 /// <summary>
146147 /// <inheritdoc/>
@@ -175,6 +176,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
175176 _currentPage = CurrentPage ;
176177 _enableThumbnails = EnableThumbnails ;
177178 _showToolbar = ShowToolbar ;
179+ _fitMode = FitMode ;
178180 }
179181
180182 if ( _url != Url )
@@ -203,6 +205,11 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
203205 await InvokeVoidAsync ( "resetThumbnails" , Id ) ;
204206 }
205207 }
208+ if ( _fitMode != FitMode )
209+ {
210+ _fitMode = FitMode ;
211+ await SetFitMode ( _fitMode ) ;
212+ }
206213 }
207214
208215 /// <summary>
Original file line number Diff line number Diff line change @@ -11,33 +11,21 @@ namespace BootstrapBlazor.Components;
1111/// </summary>
1212public enum PdfReaderFitMode
1313{
14- /// <summary>
15- /// 页面宽度
16- /// </summary>
17- [ Description ( "page-width" ) ]
18- PageWidth ,
19-
2014 /// <summary>
2115 /// 实际大小
2216 /// </summary>
2317 [ Description ( "page-actual" ) ]
2418 PageActual ,
2519
2620 /// <summary>
27- /// 页面高度
28- /// </summary>
29- [ Description ( "page-height" ) ]
30- PageHeight ,
31-
32- /// <summary>
33- /// 自适应宽高
21+ /// 页面宽度
3422 /// </summary>
35- [ Description ( "page-fit " ) ]
36- PageFit ,
23+ [ Description ( "page-width " ) ]
24+ PageWidth ,
3725
3826 /// <summary>
39- /// 自动
27+ /// 页面高度
4028 /// </summary>
41- [ Description ( "auto " ) ]
42- Auto
29+ [ Description ( "page-height " ) ]
30+ PageHeight
4331}
You can’t perform that action at this time.
0 commit comments