Forum moved here!

Home / Sumatra PDF as preview handler in Directory Opus (DOpus) - Zoom function

ByronWillis

Hey there,
First off I am new to Sumatra and am so delighted to find a lightweight PDF viewer. I’ve been using Adobe Acrobat and Bluebeam for over a decade and am just used to their sluggishness, so the lightning fast speed is sure appreciated!

My question:
I use Directory Opus as my file explorer. It has a “viewer pane” which loads a preview of the file on the right. There is an option during the installation of Sumatra that I checked which allows me to use the Sumatra engine to preview PDF’s within DOpus. They load lightning fast, and it’s great. My question is would it be possible to support zooming in/out within this preview window? It would be a great help. I asked this question on the DOpus forums and they said that this behavior would be completely controlled by Sumatra devs. Let me know if this is possible! Or if not, then it would be a feature request that I would appreciate.

Link to DOpus question:

FYI when I preview images in DOpus I am able to pan and zoom, so other handlers appear capable of doing this.

GitHubRulesOK

It is unlikely, although possible in other previewers, to zoom. That chunk of code has not been updated much in a long time. In fact the PDF preview of Windows 10 should provide zooming, or is it just my old inactive acrobat ?

The previewers are more complex than appears at first glance, and although they can support most formats including ebook comics etc .,those are not activated outside of debug builds, for many reasons including programmer resources, to close out the shortfalls.

ByronWillis

I have Windows 10 and when I use the file explorer that comes with Windows with the preview pane on, it loads a preview of the PDF but it doesn’t support zoom on my machine.

I don’t know the first thing about programming a PDF previewer, so I have no idea of the complexity of the development of this feature.

But if I understand correctly, there is not an option or setting to enable Zoom control. It’s just currently not implemented, no?

GitHubRulesOK

Correct
What SumatraPDF does for previews is considered a low enough resolution for all pages to be scrolled in whatever width/height is required so constrained by the preview window. It can be slowed down by having larger area to cover and would likely be slower if it had to constantly rebuild the image by zooming in
The “preview” should generally be just like a thumbnail a quick and dirty view of the first page/cover but there are several file managers that can include the zoomable content from SumatraPDF, so DOpus could DOtoo and that also means they can zoom ebook or password protected PDF previews or images of upto almost any size or postscript or chm / xps or …etc. you can add annotation the downside is they are just as slow as within SumatraPDF and cant access other addins like extract pages.

ByronWillis

I’m not familiar with file manager FileVoyager, but in your screenshot it looks like you are previewing a .PDF using the SumatraPDF engine and you’re also able to zoom into the PDF, suggesting that it could be implemented by the file manager as well as within Sumatra, correct?

The speed with which Sumatra loads an instance of its application and opens a PDF is plenty fast enough for me - even for a preview. Would it be possible to open an instance of Sumatra within a preview pane with the full functionality of Sumatra available to me?

GitHubRulesOK

It is a feature of SumatraPDF that it can be used as a plugin to a browser or in FileVoyager or a UniversalViewer
Because of other security concerns there are only one or two classic Netscape/Firefox browsers that still use SumatraPDF to view online PDFs. However, the similar related offline functionality can still be used as a plugin to other applications, so there are older “Lister” viewers such as those used by FarManager/Total Commander/Universal Viewer etc. and there are others like FileVoyager/PDFview that also window SumatraPDF within themselves. the key to such use is they simply use any current binary so you can see in my screenshot that is the daily SumatraPDF rather than the older bundled copy so I can use more of the context menu, such as add highlights.

Other advantages are you can change pages or search or use icons such as the recently added rotate icons. Bookmarks also work


You just cant use the ones to navigate to open another file but hey ho that what the file manager does best
image

ByronWillis

Interesting history! So modern browsers will not use SumatraPDF as a plugin because of security concerns, but its plugin functionality is still relevant to offline previewing in file explorers.

I’m interested in file explorers that window Sumatra within themselves (you mentioned a couple: FileVoyager- freeware option specifically built with SumatraPDF engine for previewing PDF’s and PDFView - Primarily developed for Mac OS, last update 2007). Are there any others you are aware of?

You 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?

PDF functions you mentioned:
1.) Highlight text. Only available thru daily build (not thru bundle).
2.) Change pages. FYI I already have this function through DOpus’ use of the Sumatra plug-in.
3.) Rotate PDF. Only available thru daily build (not thru bundle).
4.) Bookmark navigation. Is this available thru bundle? I would be interested in this.

GitHubRulesOK

Lots of possibilities abound
But to address your questions in turn.
SumatraPDF is considered fairly secure for web browsing as it did/does not currently have the Adobe flash or JavaScript to exploit. But the browser community got twitchy about using external plugins so removed CrNAPPY (pun) support. You can if you wish still use Pale Moon x32x64 or Waterfox Classic only x64 but I tend to download PDF DjVu etc. to let AV do a scan as MS seem to prefer that.
FileVoyager is one of the glossy managers that is currently well maintained (many have fallen by the wayside), If your GranPa is still about ask him about 1895 XTree I still miss its ease of calling external viewers.
the PDFView I refer to is not the Mac one but a specialised version within a database

I am not certain of FarManager but the Gh"Lister" ones are dedicated wrapper.wLx that many have adapted such as Universal Viewer. I don’t know if DOpus ever looked at those BUT not necessarily an avenue that TC alternatives would want to follow.
The up to date clones are Unreal or Double
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.

I have had to report a crash whilst test using daily build (should not happen with a normal version) so be cautious when right clicking context options :smile:

The Daily version includes Annotation (highlighting) & 2 new icons to make whole document rotation easier, plus other features such that I use it for all my Daily viewing with plain old explorer.

For permanent rotate of single pages I use a scripted addin that would not normally be accessible via a viewer but I think DOpus could pass the scripted filename and you just type in the page number / ranges by hand and see them spinning while you watch the preview.
At present SumatraPDF as a plugin should respect bookmarks but The crash I caused was trying to add the ability to store the current page as a favorite which should not be allowed as it could easily be abused to circumvent restriction by the previewer

GitHubRulesOK

Trying out Double Commander with the Total Commander plugin that seem to work well


Unreal has its own imbedded xUP pdf viewer (looks like a browser one) and its fiddly to configure the embedded Universal Viewer as it looks like 32bit but Unreal also allows to prioritise the sLister 64bit version

GitHubRulesOK

I was checking out the Tracker Exchange previewer and it has the ability to zoom see How to preview .PDF files in Windows Explorer x64 and Outlook x32 - #3 by GitHubRulesOK

ByronWillis

Heads up, DOpus is looking into supporting SumatraPDF in a future release as a PDF handler for their viewer pane!
(Sumatra PDF in the preview pane - #5 by ByronWillis - Help & Support - Directory Opus Resource Centre)

You 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.

GitHubRulesOK

Not as simple as just that from a command line as there needs to be a target URL handle
image

you need a CHILD window for parent DOpus use for the content
and it would use a different call
The sample one is as follows but a real one would be different they need to read plugin-test.cpp

rem plugin-test [sumatrapdf.exe] [url] filename.pdf
plugin-test "%~dp0sumatrapdf.exe" "contents" "Lyx Manual.pdf"
pause

Using the child plugin-test produces this
image

Also due to a number of open issues I would AT PRESENT encourage using 3.1.2 as it is still by a thin margin the most stable for that usage, otherwise users could consider 3.2 formal release but you can replace with daily and take your chances like I do.

So using exactly the same viewport but pointing the path to the most recent version does this.

This is pushing Licensing to the limit as SumatraPDF as a plugin in a commercial context is borderline.
The key to acceptance is that it maters not which official SumatraPDF.exe is used it must be unmodified and thus the same function could in theory be provided by any other onboard viewer such as Acrobat.exe etc.