File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,11 @@ import BrowserWindow from '@tdev-components/BrowserWindow';
77# PDF Viewer
88
99``` md
10- ::pdf[./assets/lehrplan-ofi.pdf]
10+ ::pdf[./assets/lehrplan-ofi.pdf]{maxHeight=450px}
1111```
1212
13- <BrowserWindow maxHeight = { ' 450px ' } >
14- ::pdf[ ./assets/lehrplan-ofi.pdf]
13+ <BrowserWindow >
14+ ::pdf[ ./assets/lehrplan-ofi.pdf] { maxHeight = 450 px }
1515</BrowserWindow >
1616
1717## Optionen
@@ -30,10 +30,10 @@ import BrowserWindow from '@tdev-components/BrowserWindow';
3030: Breite des PDF Viewers.
3131: Standardmässig auf __ 100%__ gesetzt.
3232: z.B. ` width=200px `
33- ` height `
34- : Höhe des PDF Viewers.
33+ ` maxHeight `
34+ : Höhe des PDF Viewers, nicht aber des PDF Dokuments .
3535: Standardmässig wird eine ganze Seite angezeigt.
36- : z.B. ` height =200px`
36+ : z.B. ` maxHeight =200px`
3737
3838
3939### Einzelne Seite anzeigen (` page ` )
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ export interface Props {
1717 page ?: number ;
1818 scroll ?: boolean ;
1919 width ?: number ;
20+ maxHeight ?: number | string ;
2021 minWidth ?: number ;
2122 scale ?: number ;
2223 noDownload ?: boolean ;
@@ -128,6 +129,7 @@ const PdfViewer = (props: Props) => {
128129 props . scroll && styles . scroll ,
129130 ( numPages <= 1 || props . page !== undefined ) && styles . singlepage
130131 ) }
132+ style = { { maxHeight : props . maxHeight , overflowY : props . maxHeight ? 'auto' : undefined } }
131133 ref = { ref }
132134 >
133135 < div style = { { height : `${ height + 8 } px` } } >
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ const PdfViewerNode = (
4949 attr . scroll !== undefined && toJsxAttribute ( 'scroll' , attr . scroll ) ,
5050 attr . page !== undefined && toJsxAttribute ( 'page' , attr . page ) ,
5151 attr . width !== undefined && toJsxAttribute ( 'width' , attr . width ) ,
52+ attr . maxHeight !== undefined && toJsxAttribute ( 'maxHeight' , attr . maxHeight ) ,
5253 attr . minWidth !== undefined && toJsxAttribute ( 'minWidth' , attr . minWidth ) ,
5354 attr . noDownload !== undefined && toJsxAttribute ( 'noDownload' , attr . noDownload ) ,
5455 attr . scale !== undefined && toJsxAttribute ( 'scale' , attr . scale ) ,
You can’t perform that action at this time.
0 commit comments