Skip to content

Add optional PDF support via configuration setting - #6

Merged
emako merged 3 commits into
masterfrom
copilot/add-quicklook-pdf-option
Mar 24, 2026
Merged

emako merged 3 commits into
masterfrom
copilot/add-quicklook-pdf-option

Conversation

Copilot AI commented Jan 15, 2026 •

Copy link
Copy Markdown
Contributor

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.cs: Cache Plugin.SumatraPDFReader.EnablePdfSupport setting during Init() and check it in CanHandle() for .pdf extensions (defaults to false)
  • README.md: Document configuration file location and XML setting structure

Configuration

Users enable PDF support by creating/editing QuickLook.Plugin.SumatraPDFReader.config:

<?xml version="1.0" encoding="utf-8"?>
<Settings>
  <Plugin.SumatraPDFReader.EnablePdfSupport>true</Plugin.SumatraPDFReader.EnablePdfSupport>
</Settings>

Config location:

  • Standard: %APPDATA%\pooi.moe\QuickLook\
  • Portable: <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
    • Triggering command: /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

This section details on the original issue you should resolve

<issue_title>Use plugin as PDF too [REQUEST]</issue_title>
<issue_description>I would like to use this plugin as replacement for Quicklook PDF viewer. I know there is one based on WebView2 but I like Sumatra better.
I know a little coding but I don't know how to edit the project so I can make a fork or something like that </issue_description>

<agent_instructions>加一个quicklook常用的option选项支持(本插件内置的xml文件)是否打开PDF的支持,默认不打开</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@emako I don't think it's a good alternative, but you can compile your own version.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 15, 2026 02:30
Co-authored-by: emako <24737061+emako@users.noreply.github.com>
Co-authored-by: emako <24737061+emako@users.noreply.github.com>
Copilot AI changed the title [WIP] Add option to support PDF in Quicklook alternative plugin Add optional PDF support via configuration setting Jan 15, 2026
Copilot AI requested a review from emako January 15, 2026 02:35
@emako
emako marked this pull request as ready for review March 24, 2026 17:17
Copilot AI review requested due to automatic review settings March 24, 2026 17:17
@emako
emako merged commit e5c4f7c into master Mar 24, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.EnablePdfSupport during Init() and conditionally allow .pdf in CanHandle().
  • 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.

Comment thread README.md
Comment on lines +29 to +41
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>
```

Copilot AI Mar 24, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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").

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use plugin as PDF too [REQUEST]

3 participants