.pdf extensions with Microsoft Edge by default. To replicate the seamless, native behavior seen in Linux distributions, you must manually override this system-wide association. This process involves using the Settings application or command-line tools to designate Okular as the primary handler for PDF documents, ensuring that double-clicking a file launches Okular directly instead of the browser.
Understanding the Default Behavior
On fresh installations of Windows 11, Microsoft configures the operating system to use Microsoft Edge as the default application for viewing Portable Document Format (PDF) files. This is a deliberate design choice to promote the built-in browser capabilities. When you double-click a PDF in File Explorer, Windows checks the registry keys associated with the .pdf file extension and routes the action to MSEdgeHTM. In contrast, Linux distributions like Ubuntu or Fedora typically associate PDFs with dedicated document viewers such as Okular, Evince, or Foxit Reader out of the box. This discrepancy creates a fragmented user experience where web browsers handle document rendering rather than a dedicated desktop application.
Resolving this requires changing the default app settings within Windows. While it is possible to achieve this through complex registry edits, the standard and most reliable method involves the graphical Settings interface. This approach ensures that the change is persistent across reboots and applies to all user accounts unless overridden by group policy.
Changing the Default App via Settings
The most straightforward way to fix this issue is through the Windows Settings menu. This method provides a visual confirmation of which application is currently selected and allows you to switch it easily.
- Open Settings: Press
Win + Ito open the Windows Settings application. - Navigate to Apps: Click on the "Apps" section in the left sidebar.
- Select Default Apps: Scroll down and click on "Default apps". This page lists applications assigned to specific file types and protocols.
- Search for PDF: Use the search bar at the top of the "Default apps" page. Type
.pdfor simplypdf. - Change the Handler: You will see an entry labeled "PDF" or ".pdf" currently set to Microsoft Edge. Click on the Microsoft Edge icon next to it.
- Select Okular: A list of installed applications capable of opening PDFs will appear. Select "Okular" from the list. If Okular does not appear, click "Look for another app on this PC" and navigate to the installation directory, typically
C:\Program Files\Okular, and selectokular.exe.
Once selected, Windows immediately updates the file association. Double-clicking any PDF file should now launch Okular. Note that if you have multiple versions of Okular installed or other PDF readers present, ensure you select the correct executable. This setting affects all users on the machine who do not have specific group policies applied.
Alternative Method: Command Line Association
For advanced users or those preferring automation, the command line offers a more direct route to modify file associations. This method is particularly useful if the graphical interface fails to list Okular or if you are managing multiple machines via scripts.
cmd /c assoc .pdf=Okular.Document.1
cmd /c ftype Okular.Document.1="C:\Program Files\Okular\okular.exe" "%1"
The first command sets the content type of the .pdf extension to a custom ProgID named Okular.Document.1. The second command defines what action that ProgID performs, pointing it directly to the Okular executable. Replace the path in quotes with the actual installation path if Okular is installed in a different location. After running these commands, refresh your File Explorer window, and the new association should take effect immediately. This method bypasses the Settings UI entirely and writes directly to the relevant registry hives.
Troubleshooting Persistence Issues
Sometimes, Windows may revert the default application after a major update or when opening a PDF from within another application, such as an email client or a web browser. This happens because some applications request their own internal viewer regardless of system defaults. If Okular stops opening automatically, verify the association again in Settings. Additionally, ensure that no third-party security software is locking the file association keys.
If you encounter issues where Edge still opens despite the correct setting, check if Edge has been configured to "Always open safe files." Go to Edge Settings > Cookies and site permissions > Additional permissions > PDF files. Toggle off "Always download PDF files" or ensure the option to open PDFs in Edge is disabled. For a deeper dive into forcing system viewers over browser defaults, you might find our guide on Google Chrome: Forcing PDF File Open with System Viewer on Windows 11 helpful, as the principles of overriding browser-based handling apply similarly here.
Verifying the Fix
To confirm the change was successful, create a test PDF or locate an existing one in File Explorer. Right-click the file and select "Properties." Under the "General" tab, look at the "Opens with" field. It should display "Okular." If it still shows Microsoft Edge, the association was not saved correctly. You may need to repeat the steps in the Settings menu or run the command-line script with administrator privileges. Properly configuring this association restores the workflow consistency expected by users migrating from Linux environments, allowing for faster navigation and better performance with large documents.
Frequently Asked Questions
Why does Okular sometimes open in a minimized state?
This often occurs due to window placement conflicts or previous session data stored in the configuration files. Ensure that Okular is fully closed before launching it again, and check the "Remember Window Position" setting within Okular's preferences to maintain consistent layout behavior.
Can I assign different programs for different PDF files?
No, Windows uses a single global default for each file extension. You cannot natively assign Okular to one folder and Edge to another without using third-party file management tools or scripts that intercept the double-click event.
Does this change affect how PDFs open in email clients?
Most modern email clients respect the system-wide default application. However, some web-based email services or older desktop clients may force their own embedded viewers. In such cases, saving the attachment locally and opening it from File Explorer will trigger your new Okular association.
What if Okular is not listed in the Default Apps menu?
If Okular does not appear in the dropdown list, it means Windows has not indexed it as a capable handler. You must manually browse to the okular.exe executable using the "Look for another app on this PC" link during the association process.
Will updating Windows reset my default PDF viewer?
Major feature updates can occasionally reset default applications to Microsoft defaults. It is advisable to verify your default apps settings after installing significant Windows updates to ensure your preferred workflow remains intact.