Clicking on PDF links will prompt to save file instead of allowing to open it

AlterMInd, Rethanis, clifton,

If an encoding bug . . . the following info may be helpful:


Issue 682: FPDF_LoadDocument unable to load file whose name has multibyte characters

https://bugs.chromium.org/p/pdfium/issues/detail?id=682&q=utf-8&can=2


Failed to load PDF document in Chrome

(originally posted in 2017)

https://stackoverflow.com/questions/45467019/failed-to-load-pdf-document-in-chrome

Scroll down to: “You may also find that Chrome (on Ubuntu 19.04) has a problem with the header of the name: Content-Type value: charset=utf-8.”


Getting Started with PDFium

https://pdfium.googlesource.com/pdfium/+/HEAD/docs/getting-started.md

Scroll down to: “Loading a Document”

There are three cases:

  • FPDF_LoadDocument (loading from file)
  • FPDF_LoadMemDocument (loading from memory)
  • FPDF_LoadCustomDocument (loading via a custom loader)

PDF documents can be loaded over a network — FPDF_LoadCustomDocument “is useful.”

That answers a question: Does the PDF file have to first, somehow be downloaded by the browser, so that the PDF file exists on a drive, or in memory, or in cache, and thereafter is loaded . . . -OR- . . . can the PDF file be loaded directly from a network?

As per my testing : once it has been downloaded (by whatever means or browser), it can indeed be opened in Brave. Oddly enough, Chrome succeeds in fetching it from internet and open it, while Brave just can’t. If Chromium is a common foundation to both, the issue would be in Brave itself or in its interface with Chromium.

Edit: I have just found that the problem also occurs with Brave (Version 1.26.74 Chromium: 91.0.4472.124 (Official Build) (64-bit)) on Ubuntu 20.04 ! See screenshot below where the location to download the PDF is requested.

AlterMind,

Uh . . . I meant loaded by PDFium.

I wondered if PDFium could only Open a PDF file, if the file existed in the computing device’s directory - somewhere. That is, PDFium could only load from disk.

Answer: PDFium can load from a network.

BUT, if PDFium could only load from disk — that would mean that Brave Browser would probably have the task of downloading the PDF file to one of:

  • cache
  • memory
  • some typically obscure, hard-to-find by name -type file squirreled away on disk

If that were the case, then somehow, PDFium was NOT able to load and/or open . . . and, so, why would that be? Perhaps, then, Brave Browser had somehow stuck the PDF file with a name and/or path that PDFium could not process.

Instead, I learned that PDFium can load a PDF file from a network . . . and that leans toward the problem being character encoding and UTF-8, as mentioned in the earlier screenshot.

Just in case this might help in narrowing the troubleshooting : here is a completely different PDF source that gives the same issue :

IT Service Continuity Management Overview.PDF

This PDF file name also contains spaces.

Hum, looks like their support organisation has other/more important priorities. No reaction so far.

Unfortunately, the issue you posted in has the lowest priority (P5), any activity in it is unlikely as of the moment. However, since your issue is Brave-specific (unlike the one you posted in), I would repeat the suggestion I made a few comments ago - open your own Github issue. There is no guarantee Brave developers will answer right away but Brave-specific issues are normally met with a higher interest by developers.

I will follow that advice :slight_smile:

1 Like

HI, I have the same issue - with the brave browser all pdfs I try to open up simply open up a window asking me to save it, which I often dont want to do. With all other browsers this is not an issue, I can just open it first and decide later if I want to save it.

As to the advice that 289wk wrote, I am unable to locate this option as indicated below in the settings.

In Settings: brave://settings/content/pdfDocuments

it states: “Download PDF files instead of automatically opening them in Brave”

If that switch is OFF, then the PDF file will automatically be opened.

It would be nice that not only with PDF files it would work. For zipped files or any other format, it always downloads the file… Its quite annoying to have to erase each downloaded file, when you just need to look at it.

Is it possible to include the same behaviour as the chrome, firefox or edge browser regarding the downloaded files?

Thank you

I don’t find any such setting. When I open Brave settings, there is no “content” whatsoever. I have the opposite problem, btw; Brave immediately opens in the browser, which I detest. I want it to ask what to do–open in browser, open with pdf application, or save to file. This seems pretty basic to me, and works this way with every other browser. Is there some security issue connected with asking this simple question?

In the meantime, how do I get to ANY setting that addresses pdf files?

brave://settings/content/pdfDocuments?search=PDF%20DOCUMENTS

Another way:

Settings >> Privacy and security >> Site and Shields Settings >> Additional content settings >> PDF Documents

Thanks, that worked.

It would be nice, though, if Brave had an option to open in a program rather than a browser tab. Yes, it would still be downloaded, but would immediately open in my preferred program. Oh, well, maybe in the future…

@AlterMind ,

Reminder, here, that your interest in creating a new bug case at GitHub, re your reply 36 above:

Clicking on PDF links will prompt to save file instead of allowing to open it - #36 by AlterMind

resulted in your adding a good report (Aug. 3, 2021) to an existing Brave Browser PDF (URL navigation, saving, reading, and downloading) management bug case – the Brave Community software shows the title for the GitHub case, but I wanted to note the link itself:

https://github.com/brave/brave-browser/issues/11384

and I wanted to see if there had been any progress at GitHub.

PS. It seems that @Rethanis (who contributed much, here) has not been around, lately.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.