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 1717 <div class =" bb-view-divider" ></div >
1818 <div class =" bb-view-icon bb-view-fit-page" @onclick =" FitToPage" ><i class =" fa-solid fa-arrows-left-right-to-line" ></i ></div >
1919 <div class =" bb-view-icon bb-view-fit-width" @onclick =" FitToWidth" ><i class =" fa-solid fa-arrows-left-right" ></i ></div >
20- <div class =" bb-view-icon bb-view-fit-rotate" @onclick =" Rotate" ><i class =" fa-solid fa-rotate-left" ></i ></div >
20+ <div class =" bb-view-icon bb-view-fit-rotate" @onclick =" RotateLeft" ><i class =" fa-solid fa-rotate-left" ></i ></div >
21+ <div class =" bb-view-icon bb-view-fit-rotate" @onclick =" RotateRight" ><i class =" fa-solid fa-rotate-right" ></i ></div >
2122 <div class =" bb-view-divider" ></div >
2223 <div class =" bb-view-icon bb-view-draw" ><i class =" fa-solid fa-pen-to-square" ></i ></div >
2324 </div >
Original file line number Diff line number Diff line change @@ -93,16 +93,29 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
9393 /// <summary>
9494 /// 适应页面宽度
9595 /// </summary>
96- private void FitToPage ( ) => IsFitToPage = true ;
96+ public void FitToPage ( ) => IsFitToPage = true ;
9797
9898 /// <summary>
9999 /// 适应文档宽度
100100 /// </summary>
101- private void FitToWidth ( ) => IsFitToPage = false ;
101+ public void FitToWidth ( ) => IsFitToPage = false ;
102102
103- public async Task Rotate ( )
103+ /// <summary>
104+ /// 旋转页面方法
105+ /// </summary>
106+ /// <returns></returns>
107+ public async Task RotateLeft ( )
108+ {
109+ await InvokeVoidAsync ( "rotate" , Id , - 90 ) ;
110+ }
111+
112+ /// <summary>
113+ /// 旋转页面方法
114+ /// </summary>
115+ /// <returns></returns>
116+ public async Task RotateRight ( )
104117 {
105- await InvokeVoidAsync ( "rotate" , Id ) ;
118+ await InvokeVoidAsync ( "rotate" , Id , 90 ) ;
106119 }
107120
108121 private Task TriggerFit ( string methodName ) => InvokeVoidAsync ( methodName , Id ) ;
Original file line number Diff line number Diff line change @@ -93,11 +93,11 @@ export function fitToPage(id) {
9393 }
9494}
9595
96- export function rotate ( id ) {
96+ export function rotate ( id , offset ) {
9797 const pdfViewer = Data . get ( id ) ;
9898 if ( pdfViewer ) {
9999 let rotate = pdfViewer . pagesRotation || 360 ;
100- rotate -= 90 ;
100+ rotate += offset ;
101101 pdfViewer . pagesRotation = rotate % 360 ;
102102 }
103103}
You can’t perform that action at this time.
0 commit comments