Forum moved here!

# Home / Sumatrapdf 3.2 not respecting SafeFileTypes

A_R

I linked a .txt file to a PDF file (compiled using pdfTeX) I was working on. and when I attempted to open said .txt file through clicking the link, SumatraPDF pops up the ‘Error loading’ message, and the .txt file does not open.

I’ve followed the instructions to allow links to .txt files to, in theory, be opened, by having sumatrapdfrestrict.ini have the following SaveFileType options:

SafeFileTypes = audio,video,webpage,document,text

I also checked the .txt registry to confirm that its PerceivedTypes value is part of SafeFileTypes, and ensured that the file path format will work with 3.2. Since the file is in a child directory, and I was using relative path, I started the file path with

…/path/to/my .txt file
(should be two dots before the first slash, not sure how to tell the editor to stop auto-completing to ellipses)

In addition, I then tried using the daily build version (removing the extra period from the file path format above as the daily build fixed the relative path issue in 3.2), but it still produced the ‘Error loading’ message. However, if I exported the .txt file as a PDF file, then changed the file path to open the PDF file, it works as expected.

I am using Windows 10 with the latest update.

GitHubRulesOK

If you don’t need restrictions, then there should be no need for adding the ini it does not add any functions it should only add restrictions.that can be relaxed.

I am uncertain of your pdf contents without a sample (and you would need to upload as an issue on github) however, MuPDF which is the engine SumatraPDF uses has altered the way it respects links drastically since version 3.1.2 thus many different types of links are raising issues where they did not before. (also some LaTeX font handling difficulties)
My best suggestion for LaTeX users is to keep/use a portable copy of version 3.1.2 for now, If you need to download a fresh copy the 32bit and 64bit links are here

A_R

If you don’t need restrictions, then there should be no need for adding the ini it does not add any functions it should only add restrictions.that can be relaxed.

I was doing that because as far as I know, the default SafeFileTypes is ‘audio,video,website’, which .txt files do not have any of those values in its PerceivedTypes, and based on what I gather from reading the .ini template and the relevant .cpp file, along with testing, if I don’t have the ini file with my SafeFileTypes, the program outputs an error when I click on the link to open my .txt file, even with 3.1.2.

GitHubRulesOK

If SumatraPDF is “Error Loading” on attempting to OPEN a Text file that is unfortunately due to a different setting in advanced options since it is combined with ebook handling so requires

EbookUI [
...
UseFixedPageUI = true


In 3.2 and daily you can more easily switch that by toggle ebookUI
The current alternative in some cases is for safety an embeded file (in this case text) is listed in “Bookmarks” and needs to be extracted to be run at your own risk., this is to enforce docx or xls to not autorun.