Repository navigation
Add optional PDF support via configuration setting - #6
Conversation
Co-authored-by: emako <24737061+emako@users.noreply.github.com>
Co-authored-by: emako <24737061+emako@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds an opt-in configuration flag to allow this plugin to handle .pdf files (disabled by default) to avoid conflicting with QuickLook’s default PDF viewer, and documents how to enable it.
Changes:
- Cache
Plugin.SumatraPDFReader.EnablePdfSupportduringInit()and conditionally allow.pdfinCanHandle(). - Document optional PDF support and the expected config file path + XML setting.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| README.md | Documents optional PDF handling and configuration file example/path. |
| QuickLook.Plugin.SumatraPDFReader/Plugin.cs | Adds cached setting and gates .pdf support behind the config flag. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| By default, this plugin does not handle PDF files to avoid conflicts with the default QuickLook PDF viewer. If you prefer to use SumatraPDF for viewing PDF files, you can enable PDF support by adding the following setting to your QuickLook configuration file: | ||
|
|
||
| **Configuration file location:** | ||
| - Standard installation: `%APPDATA%\pooi.moe\QuickLook\QuickLook.Plugin.SumatraPDFReader.config` | ||
| - Portable installation: `<QuickLook Installation>\UserData\QuickLook.Plugin.SumatraPDFReader.config` | ||
|
|
||
| **Add this line to the configuration file:** | ||
| ```xml | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Settings> | ||
| <Plugin.SumatraPDFReader.EnablePdfSupport>true</Plugin.SumatraPDFReader.EnablePdfSupport> | ||
| </Settings> | ||
| ``` |
There was a problem hiding this comment.
The README says "Add this line to the configuration file" but the snippet is a full XML document (including XML declaration and root). This can mislead users who already have an existing config, since pasting the whole block would create invalid XML (duplicate root/declaration). Consider rewording to clarify whether users should create the file with this full content if it doesn't exist, or add only the <Plugin.SumatraPDFReader.EnablePdfSupport> element inside an existing node (and call it the plugin config file rather than the generic "QuickLook configuration file").
Adds opt-in PDF file handling to avoid conflicts with QuickLook's default PDF viewer while allowing users who prefer SumatraPDF to enable it.
Changes
Plugin.SumatraPDFReader.EnablePdfSupportsetting duringInit()and check it inCanHandle()for.pdfextensions (defaults tofalse)Configuration
Users enable PDF support by creating/editing
QuickLook.Plugin.SumatraPDFReader.config:Config location:
%APPDATA%\pooi.moe\QuickLook\<QuickLook>\UserData\Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
esm.ubuntu.com/usr/lib/apt/methods/https /usr/lib/apt/methods/https(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.