Main navigation

Searching PDF documents: a new feature in Podofyllin

One of the most popular features in PDF readers, Find (or Search if you prefer) isn’t built into the macOS PDFKit. This is odd, because its sibling for rich text, TextKit, does have good readymade support for Find. But look in PDFKit, and although some of the supporting features are there, it’s as if the engineering team had to suddenly rush off to do something different before it could be completed.

It’s even worse than that, of course, because TextKit doesn’t have one Find system but two: one working from a small bar at the top of the window, the other from a Find window with more extensive controls. When discussing their merits recently, I think we all agreed that the window was a superior solution for most users, although for quick and simple searches, a Find bar is unobtrusive and efficient.

When I started to implement a proper Find window for my PDF reader Podofyllin, I realised that it had a problem. With four different views in the same window – thumbnail, PDF, text, and outline (contents to come in a future release) – of which the text view already has a Find window, adding another Find window for PDF was going to result in a confusing mess.

In this case, notwithstanding the fact that a separate Find window is generally preferable, a Find bar looks and works better. To achieve that, it has some bells and a whistle or two.

As you type your search term into its field (which grows when you enlarge the window), live search finds the first matching word character by character. This often means that you don’t have to type in the whole word to get good hits. Press Return when you’re happy that the term is specific enough, and it will be added to this drop-down menu of recent searches, for ready access later.

You also have two options, to search with case sensitivity, or literally, in which every character must match exactly.

Once the first hit is selected, move forward to the next using ⌘], or move back with ⌘[. If you’ve already selected the characters in the PDF which you wish to use as a search term, press ⇧⌘F (Shift-Command-F) and that will become the next term for the search, and its first hit will be selected for you already.

The only feature that this doesn’t support is the use of regular expressions.

One final advantage over a Find window is that of gaining focus. With two different search systems active, which takes precedence depends on whether the PDF or Text view is in focus (active). The moment that you click to use the PDF search, it brings that into focus, so it then gets on with the job.

I hope that you find this a valuable feature in this new version of Podofyllin. It also gives you a glimpse of where it’s going next: when you have a PDF document open, using the new command Open Source (pun intentional) in the Window menu opens a window in which some of the internal data of the PDF are displayed. I’m now working on parsing the contents to give you insight into what your documents contain.

Podofyllin version 1.0b4 is now available from here: podofyllin10b4
and from Downloads above.

Related

6Comments

I finally found a moment to check Podofyllin. Since it is tax season here, I opened i1040gi.pdf, the instruction for the man federal tax form, in Podofyllin, Preview, and Acrobat Pro DC. Unless I enlarge the view to ‘too big to fit on the screen’, both Preview and Podofyllin are painful to read. The glyphs are fuzzy (pixelated edges) as compared to the relatively crisp display of Acrobat.

I do not know if this is characteristic of the Apple rendering engine — I assume Adobe does their own thing as always.

Thanks.
Without looking at the file, it’s hard to see why this should happen, although it might relate to font content, perhaps. Yes, Adobe has its own PDF engine, but ultimately it draws to the display using the same Quartz 2D code.
Preview and Podofyllin both use the Quartz PDF engine, though.
Is there a public link for that file, please?
Howard.

OK, I’ve had a chance to look at that IRS document very carefully on my 5K display in Mojave’s Dark Mode (for what little difference that makes with PDF) and font smoothing turned on (again, no detectable effect). What I see is identical in Podofyllin and Adobe Acrobat Pro 19 (current). This is true at all levels of zoom, and all window sizes – crisp in those, and in Safari’s online preview too.
So I don’t know what’s going on there, I’m afraid.
Howard.