Search
Let users search the text of a PDF in an Electron window with NexPDF, and control the search item.
License module
Search is part of the viewer module and works without a key.
The search item in the toolbar opens the search tab of the side panel, which searches every page
of the document.
To remove the search item, hide it:
{ "toolbarConfig": { "hiddenItems": ["search"] } }To move it to the front of the toolbar, list it in toolbarConfig.order:
{ "toolbarConfig": { "order": ["search"] } }Pass the configuration as the path of a JSON file; see Viewing pages.
Find and redact
The Redact mode has its own find, which marks every match for removal. See Redaction.
Scanned documents
Search finds only real text. Run OCR on scanned pages first.
From code
To search in code, without a window, use the
document API
(openDocumentFile, then doc.search(query); see the Node.js SDK).