You may use SumatraPDF 3.7
1. Overview
There are two ways to enable PDF previews in XYplorer using SumatraPDF:
Option 1 — Standard installation (recommended)
Install the regular, non-portable version of SumatraPDF. The installer automatically registers the Preview Handler in Windows.
Option 2 — Portable version (manual registration)
If you prefer using the portable version of SumatraPDF, you can manually register its Preview Handler in Windows by following the instructions below.
This allows you to keep using SumatraPDF as a portable application without performing a conventional installation.
2. Required Components
For the portable version, you will need:
- A portable copy of SumatraPDF.
- The **SumatraPDF 3.7 installer**, matching the architecture (32-bit or 64-bit) of your XYplorer installation.
- The following files:
- `PdfPreview.dll`
- `libsumatrapdf.dll`
Important: The Preview Handler architecture must match the architecture of XYplorer.
3. Downloading and Extracting the Required Files
Download the **SumatraPDF 3.7 installer** from the official website:
https://www.sumatrapdfreader.org/downlo ... pdf-viewer
You do not need to install the application. Instead, extract the installer contents using the following command:
Code: Select all
SumatraPDF-3.7-64-install.exe -x -d "D:\Programs\SumatraPDF"
Adjust the filename and destination path if necessary.
After extraction, make sure the following files are present in the destination folder:
- `SumatraPDF.exe`
- `PdfPreview.dll`
- `libsumatrapdf.dll`
4. Registering the Preview Handler
Create a BAT file named `RegisterSumatraPreview.bat`:
Code: Select all
@echo off
set "DIR=D:\Programs\SumatraPDF"
set "CLSID={3D3B1846-CC43-42AE-BFF9-D914083C2BA3}"
if not exist "%DIR%\PdfPreview.dll" (
echo PdfPreview.dll not found!
pause
exit /b 1
)
regsvr32 /s "%DIR%\PdfPreview.dll"
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\PreviewHandlers" ^
/v "%CLSID%" /t REG_SZ /d "SumatraPDF Preview Handler" /f
echo Done.
pause
Change `D:\Programs\SumatraPDF` to the actual location of your SumatraPDF folder.
Run the BAT file as Administrator.
5. Configuring XYplorer
1. Open XYplorer Configuration.
2. Navigate to **Preview → Previewed Formats**.
3. Select **User-Defined Preview Handlers**.
4. Add the following handler for PDF files:
Code: Select all
md>{3D3B1846-CC43-42AE-BFF9-D914083C2BA3}
5. Apply the changes.
6. Important Notes
- Windows stores the absolute path to the DLL. If you move the SumatraPDF folder, you will need to register the Preview Handler again.
- Make sure the DLL files come from the same SumatraPDF 3.7 distribution.
- When updating SumatraPDF, it is recommended to repeat the registration process.
7. Unregistering the Preview Handler
To unregister the COM component, run:
Code: Select all
regsvr32 /u "D:\Programs\SumatraPDF\PdfPreview.dll"
To remove the Preview Handler entry from the Windows registry, run:
Code: Select all
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\PreviewHandlers" ^
/v "{3D3B1846-CC43-42AE-BFF9-D914083C2BA3}" /f
---
**Result:** SumatraPDF can now be used as a PDF Preview Handler in XYplorer, either through its standard installation or through manual registration of the portable version.
Unfortunately, in preview it does not allow selecting text. So I consider this a workable option, but not the best.