File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ import type {
30
30
import { HighlightLayer } from "./HighlightLayer" ;
31
31
import { MouseSelection } from "./MouseSelection" ;
32
32
import { TipContainer } from "./TipContainer" ;
33
+ import type { PDFViewerOptions } from "pdfjs-dist/types/web/pdf_viewer" ;
33
34
34
35
export type T_ViewportHighlight < T_HT > = { position : Position } & T_HT ;
35
36
@@ -75,6 +76,7 @@ interface Props<T_HT> {
75
76
transformSelection : ( ) => void ,
76
77
) => JSX . Element | null ;
77
78
enableAreaSelection : ( event : MouseEvent ) => boolean ;
79
+ pdfViewerOptions ?: PDFViewerOptions ;
78
80
}
79
81
80
82
const EMPTY_ID = "empty-id" ;
@@ -159,7 +161,7 @@ export class PdfHighlighter<T_HT extends IHighlight> extends PureComponent<
159
161
}
160
162
161
163
async init ( ) {
162
- const { pdfDocument } = this . props ;
164
+ const { pdfDocument, pdfViewerOptions } = this . props ;
163
165
const pdfjs = await import ( "pdfjs-dist/web/pdf_viewer.mjs" ) ;
164
166
165
167
const eventBus = new pdfjs . EventBus ( ) ;
@@ -181,6 +183,7 @@ export class PdfHighlighter<T_HT extends IHighlight> extends PureComponent<
181
183
textLayerMode : 2 ,
182
184
removePageBorders : true ,
183
185
linkService : linkService ,
186
+ ...pdfViewerOptions ,
184
187
} ) ;
185
188
186
189
linkService . setDocument ( pdfDocument ) ;
You can’t perform that action at this time.
0 commit comments