Sumatra PDF is a PDF, ePub, MOBI, CHM, XPS, DjVu, CBZ, CBR reader for Windows

"Find" in open document (suggestions)

Hello,

Thank you for making an amazing and lightweight pdf reader program. What I would like to request (I was not able to find) was to have an overview of all the found elements for a specific text. I believe it is much simpler to have an overview of all found elements than going through them one by one using the find next functionality already implemented.

Below is a screenshot from another pdf program, which offers this functionality (though it is already free for commercial use, they have discontinued this version) but I would like to use Sumatra PDF as my main pdf reader since I like the simplicity with its full feature set.

I tried searching for a similar request, but found nothing that was equivalent, therefore the new thread.

Thank you again for the great program, I am looking forward to future improvements!

1 Like

There are multiple relevant threads going back many years if you search the old forum. Anyway, you can add your support to the following 2+ year old issue and maybe it will be implemented one day:

Hello everyone,

I first want to thank you for all of the work you’ve done on Sumatra pdf it is a wonderful application that I use a lot as a graduate student. I do have a feature request for the find function. If you’re willing to look into this it would make my workflow a lot quicker when using pdfs or other formats that you support. When I try to find something in a pdf Sumatra will find and highlight only one at a time. I would like to be able to see not only all of the words highlighted but to also have a count of matched words found with the position of the currently highlighted word among those found. Google Chrome, and MS Edge both do this well but Sumatra is just better in many other areas for looking at pdfs. Thank you for your time and work on this wonderful application.

1 Like

Word count feature has also been requested but couldn’t find the relevant issue.

The only thing that I’m missing every day are advanced search options. A quick way to get a grasp of all the occurrences of a particular word or phrase within a document would be a huge improvement and time saver. I keep a copy of STDU Viewer on all my computers just because it does this…

I’m not the biggest fan of how the find function works. To me it wasn’t obvious that you needed to press f3 to cycle through the found instances. I would prefer a keep pressing enter system or maybe make it a bit more obvious that f3 needs to be pressed. Or maybe I am just an idiot haha. Anyway have a nice day everyone!

F3 and (less commonly) Shift+F3 have traditionally functioned as shortcuts for Find Next/Prev in many Windows apps such as Notepad and Wordpad, browsers such as Firefox and Edge etc.

There are also Find Next/Prev arrows right alongside the Find text field, so even if you had no clue about F3 you could’ve always used those.

Not to mention that as long as the focus remains in the Find text field, you can indeed keep pressing Enter to cycle through the found instances.

Thanks by the way for making such a lightweight pdf viewer. I think something is not working for me then because if I press enter from the find text box it disappears with further enter presses only moving down the page. Also there are not Next/Prev arrows in my Find text field.

The Find Previous, Find Next and Toggle Case Sensitivity should always be visible to the right of the Find field, right from the start (i.e. even if not usable without a file open)

The appearance varies from version to version but should always be there unless in another viewing mode so it is removed when viewing fullscreen or in comic book / image mode or if using the alternative flowing help file or ebook interfaces where the text is not static but constantly reflowing.

Ok thanks for taking the time to explain it I found the problem. It was that I had the toolbar turned off. When using the popup find box the repeated enter thing doesn’t work.

@FWHL
I agree that in the “find box” the F3 “hint” is not very prominent and I too would expect enter to be an equivalent action, since it is in many other apps.

@kjk
Is there any way the repeated use of the find dialog can be enhanced to allow search forward / back from current entry ?

I’d like to use the Find option to search a word from the page the cursor is currently at, instead of from its very first mentionon onwards (and if possible, also backwards).

Thanks in advance.

It depends where you start from so here I start on page 12 and if my target was " und " we can see it will first find U in the top line then UN in the secondline then und in aufgrund then next would be my target BUT if I started with " U then my target is next e.g. " UN

I wrote a command line.cmd script some time ago to search forward for next one or two words (same as acrobat command line) from a given location (page or named-dest) but can on occasion be flaky (mainly focused keys timer issues) you could try similar with a backwards option Shift + F3
But it would make more sense to script as a Hotkey.ahk where focus can be kept under control.

My document is 2147 pages long, and it always goes back to the first mention (incidentally, in the very first page) no matter what…
How should I proceed then?

Yes, there can be odd behaviour when you start an entry with a character or two since they will often be found on first page, in such a case it is best to enter the search word then try ALT with left arrow to go back to previous page then re-start the search from there.

Looking again at my own use for my script It was intended to be used as an external
Goto this file > @This name/page > then Find "some text"

I currently am trying to modify it to
From current file prompt user for Find “some text” but you already do that anyway in the search box. the difference is how to store current page (%p) first but again that’s what SumatraPDF does for ALT Left arrow usage.

I see you are “off radar” (like me e-mail replies are off) but I am still bettering one of my scripts in case you or others are able to use/test it. Beta testing is progressing but slow since it needs to be tuned to work inside SumatraPDF as well as from outside, thus it needed some esoteric hybrid commands.

Anyway it seems to be functional here I am on page 11
image
and there are many entries with that phrase in the early contents pages (which I could use to jump forwards from) but in this case I wish to find the next one going forward. Thus with script in place I can either use the menu OR use ALTF/ to call up this dialog box. Enter (type) or paste (right click) my search term / words and it will jump to the next location where the phrase is found either on the current or following pages (in this test case page 13). If I want to search back then I can easily use < icon and the previous entry is instantly found on Page 10.

I must say though there is not much difference to using the find function as it stands internally within SumatraPDF. So the best use for this script is probably for running a scripted batched sequence based on a list of filenames.
For those that want to try it look in the search folder MyNotes/AppNotes/SumatraPDF/Addins at master · GitHubRulesOK/MyNotes OR click here to read the full commented script
For what its worth here is VirusTotal entry currently 100% clean but MS will try to block it, Best to download as plain.txt then rename it to SpdfGoTo.cmd

as with other addins it uses the SumatraPDF-settings.txt file to add as an “ExternalViewers” command

ExternalViewers [
	[
		CommandLine = c:\windows\system32\cmd.exe /d /c ""%addins%\Search\SpdfGoTo.cmd" -g="GetString" page=%p "%1" "
		Name = &/Find from current page
		Filter = *.*
	]
 ]

I suggest the addins are kept together as I keep them together using \SumatraPDF\addins\sub folders but for a one off just edit %addins% above to suit your own location.

Note it is an early draft that needs some adjustments to timings so for example if a file is not already loaded in SumatraPDF session it may need when run externally either a delay added or any commands can be called twice to ensure the requested file is opened first then traversed to the targets.

The first thing you may wish to customise (apart from color) is the size of the query box so I suggest add a MODE line below :GET$ like this

:GET$ assume only needed after PAGE# for now but NAME# can dribble through
Mode 52,4

then it looks better as now much smaller
image
of course you could add a Color line above the Mode line to one of your own liking

I forgot to mention how powerful a cmd window can be, so for example just like in SumatraPDF double click an echoed word or strike over multiple words then right click to copy and right click again to paste so here I have added some common searches
image
I double click “contents” (ignore the extra end space its not copied) and for illustration I have double right clicked to paste it for my search, so just need to hit enter to go to next occurrence. You could also easily adapt the script to ask for a page number to re-start from, but there I leave the challenge other than to mention you would need to add an override in the dialog as
set /p Target="Start Page = "