Sumatra PDF in the preview pane

Hey there,
I was just learning about the way that the preview pane plug-in (ActiveX + Preview + Office + Web) works and I was able to set my standard PDF editor (Bluebeam) as my default program and Sumatra PDF as my viewer pane utility, which allows for some lovely fast loading (Bluebeam previewer was sluggish).

In the process I disabled all .pdf previewers for a moment and I noticed I was still able to preview them. It said something like "shell thumbnail" or similar. I believe that this was loading some sort of thumbnail of the PDF as an image. The cool thing is that I was able to zoom on the PDF in the viewer - something that is not supported at all by Sumatra preview nor is it well supported by Bluebeam.

My question is four-fold
1.) Is there a way to enable Sumatra to support zoom? It's SOOO fast to load!
2.) If I were to use the "shell thumbnail" option, would it allow me to scroll through multi-page PDF's? I assume no.
3.) Is there another lightweight / fast PDF viewer out there (similar to Sumatra) that would support zoom in the viewer pane?
4.) I noticed that when go from one image to the next, the Zoom choice (25%, 50%, etc.) is maintained. Can I make a setting adjustment to have it "fit to window" whenever a new file's preview is loaded? I saw this option was possible in the separate viewer app, but I want to control this behavior within the viewer pane.

Thanks,
Byron

1 Like

You'd have to ask the Sumatra developers that. What it does or doesn't do is entirely up to it.

No, thumbnails are just basic bitmap images. For PDFs they're usually bitmap images of the first page/cover.

There are a few other PDF viewers. I don't have much experience with them so I don't know which others might fit your needs. Adobe Reader, PDF-XChange and FoxIt are the main ones people use in addition to Sumatra.

Just select that option in the viewer pane (e.g. using the buttons at the top of it, or via the right-click menu when an image is being displayed) and it will be used for the next file automatically.

Leo,
Thanks for the quick reply!

Regarding #4, I think there's some miscommunication. The behavior I observe now is that when I set the zoom level for an image it applies that same zoom level to the next image. I would like it to reset to "fit to window" whenever I click on a new image rather than to apply whatever the previous setting was used. I read that this was possible in the standalone viewer, but I would like to control this behavior in the preview pane.

Leo,
Per your recommendation I posed this question in the Sumatra forum and they have responded.

They suggest that although it is possible to implement within Sumatra, it is also possible to implement using the Sumatra engine within DOpus. They provided an example of another file manager (FileVoyager) that utilizes the Sumatra engine to load a preview and it is still then able to use Zoom within the preview pane.

Would this be a lot of work to implement? It seems similar to the way that image viewer pane zooming is handled?

Byron

Here's another idea! They have since replied with a lot more info in the Sumatra forum leading me down some other paths.

They mentioned a couple of others that utilize Sumatra as a plugin.
1.) Far Manager (text based file manager)
2.) Total Commander (Formerly Windows Commander, $46, file manager)
3.) Universal Viewer ($26, file viewer of many many types, PDF viewing based on Sumatra)

As I was looking into #3 above I discovered this link. (Sumatra PDF based plugin 0.8.1 - Total Commander) It’s the plug-in for PDF viewing utilized by Universal Viewer. Is this something that could be easily integrated into Directory Opus’ preview pane? Another idea I had is could I buy Universal Viewer, and use it for all preview tasks within Directory Opus?

Universal Viewer (at least if I've found the right one) looks like a standalone viewer app, not something that integrates into File Explorer or Opus's viewer panes, so that probably won't help (although I may be wrong).

Writing an Opus viewer plugin around the Sumatra code, in order to get more control over how it works than the preview handler offers, is certainly interesting. We didn't know that was an option before now. We'll add that to the list of things to look at, but it's a big enough piece of work that it will take a while before we can get started or look into it in detail. Thanks for drawing our attention to that, as it could be a good option in the future.

2 Likes

Cool thanks, Leo!

The fact that I am able to have meaningful communication with the development team for DOpus makes it so worth it to me. Please never sell out to Windows! :smiley:

2 Likes

One other link that may be helpful. this is some sort of PDF viewer .dll.
https://www.hmgforum.com/viewtopic.php?t=5112&start=150

A SumatraPDF forum expert wrote:
In theory you can write your own with say VB or AutoHotKey since all you need to provide to SumatraPDF is the -plugin argument i.e. numeric handle of the window you generate first. so should be easy for DOpus to handle that call.

This sounds like a great option. Thanks for this idea. So if I call "Sumatra.exe -plugin ", it will load into the viewer pane? I would check with DOpus how to automate this call whenever the viewer pane is activated and I've selected a PDF file.

1 Like

Will that get you anything different to what Sumatra's preview handler already does? It won't magically hook up the zoom in/out buttons in Opus to Sumatra, for example. (Sumatra may have it's own zoom buttons, though. Many PDF viewers do. But I thought your issue with the preview handler was the lack of that.)

Hi Leo
As you may be aware I am NOT developer of SumatraPDF just a double agent / moderator :slight_smile:

If you see my most recent reply to Byron I mentioned that the plugin method was initially intended for use within browser frames but was built well enough to act as as a slightly restricted client app in an applications frame. The functions should be limited to those shown on the icon bar (currently I think file open icon is restricted in pre-release as it formerly was "save as" for downloading)
image
Newest SumatraPDF.exe has rotation icons, but Byron's interest is that he can use the zoom and Bookmarks for internal navigation.

Pros its more extensive than basic thumbnail type previews and should handle all image eBook types not just PDF. here with GS on path is the contextual details of viewing a PS file could be .tga, multi-page Tiff etc. (all can be zoomed or searched )
image

Cons its more extensive than basic thumbnail type previews, so could take longer to render a Gargantuan compressed cover image. Mitigation should be possible in DOpus for focus to be shifted outside the frame to another previewed file.

background command would be

a config entry to any external compatible application, e.g. "Location of users choice portable/installed SumatraPDF.exe" followed by needed arguments in this case -plugin "current file path\name" #HWND or similar
best read SumatraPDF source for the plugin test application.

1 Like

I emphasise the need for a comercial allplication to distance itself from GPL requirements by pointing out, that similar uses are NOT dependant on hard coding their dependency on SumatraPDF simply using as an optional Standalone product.

Configuration choices should be user determined as to which if any FTA are passed as accessible by SumatraPDF, the list is long and there are caveats such as:- Some extensions e.g. .AI or .ORA may be unexpected but can be processed, whilst others like .EPS .PS .PRN .PJL depend on GhostScript being present so as to render in %temp%.
Some such as Password protected PDF may throw up a dialog box to request permission to view but protected CBR will most likely stay blank.

This list is not exhaustive but these are the ones that a user should be able to select from thus you may need a mechanism to allow for user constraint ?

CSVpad v1.2 export: long list.csv

long list.csv

.pdf 1 pdf Applications\SumatraPDF.exe
.vbkm 1 pdf 16 text Applications\SumatraPDF.exe
.chm 10 chm Applications\SumatraPDF.exe
.epub 11 epub Applications\SumatraPDF.exe
.mobi 12 mobi Applications\SumatraPDF.exe
.azw 12 mobi Applications\SumatraPDF.exe
.azw3 12 mobi Applications\SumatraPDF.exe
.fb2 13a fb2 Applications\SumatraPDF.exe
.zip 13b fb2.zip Applications\SumatraPDF.exe
.fb2z 13b fb2.zip Applications\SumatraPDF.exe
.fbz 13b fb2.zip Applications\SumatraPDF.exe
.zfb2 13b fb2.zip Applications\SumatraPDF.exe
.pdb 14 pdb Applications\SumatraPDF.exe
.prc 14 pdb Applications\SumatraPDF.exe
.dib 15 images AppX43hnxtbyyps62jhe9sqpdzxn1790zetc
.png 15 images PBrush
.bmp 15 images AppX43hnxtbyyps62jhe9sqpdzxn1790zetc
.jpeg 15 images PBrush
.tga 15 images Applications\SumatraPDF.exe
.tif 15 images PBrush
.webp 15 images PBrush
.tiff 15 images PBrush
.jpg 15 images PBrush
.gif 15 images PBrush
.jxr 15 images ?? AppX43hnxtbyyps62jhe9sqpdzxn1790zetc
.log 16 text txtfile
.tcr 16 text Applications\SumatraPDF.exe
.txt 16 text txtfile
.NFO 16 text txtfile
.ai 2 pdf Applications\SumatraPDF.exe
.oxps 3 xps Applications\SumatraPDF.exe
.xps 3 xps Applications\SumatraPDF.exe
.xod 4 xps Applications\SumatraPDF.exe
.djvu 5 djvu Applications\SumatraPDF.exe
.djv 6b djv Applications\SumatraPDF.exe
.prn 7 ps Applications\SumatraPDF.exe
.ps 7 ps Applications\SumatraPDF.exe
.pjl 7b ps Applications\SumatraPDF.exe
.eps 8 eps Applications\SumatraPDF.exe
.cbr 9 cbx Applications\SumatraPDF.exe
.cbt 9 cbx Applications\SumatraPDF.exe
.cbz 9 cbx Applications\SumatraPDF.exe
.cb7 9 cbx Applications\SumatraPDF.exe
.jfif ?? PBrush
.jpe ?? PBrush
.ora cbz images Applications\SumatraPDF.exe
.ini NO ?? inifile

Created using CSVpad v1.2 by: TrustFm.

Leo,
I may be totally wrong, but I understood this idea to be that the viewer pane would just be a blank window (no controls) and that an instance of SumatraPDF or a lightweight version / previewer could be called from DOpus and instantiated within the window, which would include whatever controls that Sumatra provides.

Here's what the SumatraPDF plug-in looks like (credit goes to GitHubRulesOK)
sumatraPDF plugin

Looks like it includes page navigation, some zoom options, and the ability to search. All of which I would utilize!

That's exactly how preview handlers work already, but (having tried it now), it seems the Sumatra preview handler is a really simplified version of the program with no toolbar.

My mistake! So then the controls that I saw (see below) didn't come with the Sumatra plug-in? They were part of the lister program?

sumatraPDF plugin edited

@ByronWillis
The controls are in the main application which can be non installed portable thus provided when in plugin mode which has limited keyboard or context controls. So for example you cannot press F to go fullscreen it would defeat being a plugin. but the controls can be toggled off and on using F9 :slight_smile: Useful if you have giant customised icons and wanted a clear pane :rofl:

The previewer needs to be installed as a sub-module of windows which to be fast offers a reduced image for thumbnails and preview panes with only a scrollbar on the right to drag so as see other pages "quickly"

2 Likes

I just checked and I see I lied since in more recent 3.2 you can use new duplicate window CTRL+Shift+N to popup a copy of the plugged in file and maximise that without the keyboard control menu (just the toolbar with icons) so not sure if that really should be allowed. (Keep that bonus quite for now, or it may need fixing)

P.S. tried to run DOpus beta but got this image

same on retry so had to use webpage but still no joy with the given code
image

2 Likes

Odd cant add back an image to above

Custom icons were only possible in the past i.e. up to current version 3.2 (now they are supposed to be leaner svg)

I'm sure Leo will help you get up and running!