File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed
Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 239239 "type" : " boolean" ,
240240 "default" : false
241241 },
242+ "enableEraser" : {
243+ "description" : " Enable the eraser to erase annotations like Ink." ,
244+ "type" : " boolean" ,
245+ "default" : false
246+ },
242247 "enableOptimizedPartialRendering" : {
243248 "description" : " Enable tracking of PDF operations to optimize partial rendering." ,
244249 "type" : " boolean" ,
Original file line number Diff line number Diff line change @@ -649,6 +649,10 @@ const PDFViewerApplication = {
649649 }
650650 }
651651
652+ if ( ! AppOptions . get ( "enableEraser" ) ) {
653+ appConfig . toolbar ?. editorEraserButton ?. parentElement . remove ( ) ;
654+ }
655+
652656 if ( appConfig . secondaryToolbar ) {
653657 if ( AppOptions . get ( "enableAltText" ) ) {
654658 appConfig . secondaryToolbar . imageAltTextSettingsButton ?. classList . remove (
Original file line number Diff line number Diff line change @@ -228,6 +228,11 @@ const defaultOptions = {
228228 value : true ,
229229 kind : OptionKind . VIEWER ,
230230 } ,
231+ enableEraser : {
232+ /** @type {boolean } */
233+ value : typeof PDFJSDev === "undefined" || PDFJSDev . test ( "TESTING" ) ,
234+ kind : OptionKind . VIEWER + OptionKind . PREFERENCE ,
235+ } ,
231236 enableGuessAltText : {
232237 /** @type {boolean } */
233238 value : true ,
You can’t perform that action at this time.
0 commit comments