Hacker News new | past | comments | ask | show | jobs | submit login
Save web pages as PDF in Firefox for Android (support.mozilla.org)
237 points by inxode on Dec 26, 2022 | hide | past | favorite | 108 comments



Cool feature, although I note with some irony that once I have the PDF downloaded, I still have to then use Google's Drive PDF reader or some other tool to open it.

Maybe work on a full stack PDF renderer like the desktop version has, Mozilla?


This is in the works. It's the same codebase as the desktop version, which is written in js.

I've tested it on low end Android phones from 2017, it works well, when compared to the native offering, and also on modern high end phones, it also works well of course.

What's missing is mobile specific UX, such as pinch-to-zoom, and UX/UI refinements, so it's nice to use.

It has form support, annotations and other goodies like the desktop version as well, which I find very useful.

about:config in Firefox for Android Nightly,pdfjs.disabled to false to give it a go.


> This is in the works.

Nice! Will it be exposed system-wide so that I can open PDFs from within any other app in Firefox?


This sounds pretty cool! I tried enabling it in Fennec (F-Droid "debloated" version with about:config available) and couldn't get it to work. It still downloads PDFs and prompts the system app picker for the viewer.

Did you have to enable anything else?


They already have a pdf reader they could add with ease https://github.com/mozilla/pdf.js


I don't know what their priorities are but this is the extension I use on firefox mobile so that it can do what safari has been able to do since like ios 3 (open pdf's in the browser). You have to add it to a custom addon collection, which I think you can only enable in beta or nightly: https://addons.mozilla.org/en-US/android/addon/android-pdf-j...


> I don't know what their priorities are

When I used Android, I was never bothered that PDFs opened in the PDF viewer. I was pretty much fine with it. The PDF viewer (not from Google, an open source app) worked pretty much like iBook with a library function, so it was convenient like this actually. It does not look like something to be fixed with high priority. Looks more like a nice to have to me. Why does it matter that they are shown in the browser?


Put simply: PDF content is common enough on the web that it should be viewable as a webpage without having to jump out of the browser app. It breaks the user experience and for searches that may return many pdf results, the minor hassle becomes a major impairment (having to jump between two apps now). It is the case for all desktop browsers for many years now and ios that they open in browser first, so why should it be any different for Android?

I see the utility in you having an external app to view your pdf's (especially longform books in pdf would be best opened in a dedicated ebook reader app), but there is no consistent user experience on Android, each vendor has their own bundled apps, and some may not even bundle their own app.



What do you mean "have to"? Why not use one of the plenty ope source PDF viewers for Android?


Because for a dead simple read-only PDF viewer, I trust Google's security team over random Play Store app to properly sandbox the PDF and not let it do shady shit to my phone upon opening.

I'd trust Firefox more if they provided one, but in their absence, Google has the talent and the resources to do it properly.


Doesn't it mean the PDF file gets uploaded to Google drive then ?


It does not. It is just a name. The file stays on the device and is not uploaded to Google Drive.


No there's a local viewer


Samsung phones open PDFs in their Notes app. Besides that, I think most people just install Adobe Reader because it's what they know.


I'd expect googles pdf viewer to be comparable to others using well established libraries, such as poppler and mupdf.


Currently, most of the PDF viewers from f-droid report they have a security vulnerability and the f-droid app recommends uninstalling them. For example:

https://f-droid.org/en/packages/com.foobnix.pro.pdf.reader/

No explanation on what the vulnerability is.


According to the forum discussion [1] you can find the explanations (when they're not included in the app description) in the MaintainerNotes part of the metadata file, which is linked from the page that lists all vulnerable apps [2] and as "Build Metadata" on the page you linked. Not very obvious, but at least the info is available somewhere.

[1] https://forum.f-droid.org/t/vulnerability-warnings-in-f-droi...

[2] https://monitor.f-droid.org/anti-feature/KnownVuln


The ones on f-droid are each horrible in its own specific way - some don't support scrolling, some don't support pinch-to-zoom, some have UX from 2012, some don't allow you to save the file (how am I supposed to save a bank statement then?).


I quite like MuPDF. For ages its UI was small but dated; it looks less dated now. That said, I don't remember there being a save button...


No idea why people are complaining about the pdf readers in f-droid.

The MuPDF android versions are great, and KOReader is the best ebook and pdf reader I've ever used.

Maybe other people have other use cases, but the above work really well, and don't have known security vulnerabilities (since another commend complained about that).


Isn't Firefox open source? I mean, maybe fork a repo and code that? Or encourage/sponsor those who will?


This is great, though with the usual formatting caveats of pdf printing from any browser! Firefox for Android used to have this feature up to version 60's somewhere but it was removed. I've found it useful on my android to keep an old version of firefox for limited use when I need things like pdf generation or various "unapproved" addons. Now that most of my extensions work on Firefox Nightly (with AMO), and with restored pdf functionality, there isn't much reason to keep the old version around. I'm very happy lately with firefox, both on desktop and android. I wish it would recover some market share from chrome.


Great! It only took them (checks revisions) 2 years to migrate the feature from the old fennec version.

Seriously though, I'm happy they are making progress and restoring the missing functionality, even if it takes them time. I still miss the dedicated "view-source" button (the feature is ready, but you need to remember the url and then write it) and the swipe to see history/bookmarks directly, but the version is now stable and most of the bugs from the early days are now fixed.

The home screen and the new tab functionality is still a mess though.


I still miss the tab queue, and the ability to send an URL to another Firefox device from another app, without having to open it in Firefox Android first.


But can I (again) open said PDF inside Firefox? Last I checked, the ability to open local files had been removed -which was maddening.


Reading PDF files (using PDF.js) is being tested in Firefox Nightly for Android.

https://bugzilla.mozilla.org/show_bug.cgi?id=1754499


Can it already support any plugin I want on Android, like it used to be possible before 2020?


If you go through the rigmarole of setting up an AMO account, installing a pre-release version and then creating a curated list of add-ons and then changing a browser setting, sure!

Didn't you know that users are too dumb to be able to select add-ons to install themselves? This way, users are protected from themselves!


No, I thought Firefox was for users who know what they want. We already have <default browser> for others.

Also, having to create an account to use addons is not really acceptable to me.


Not yet no.


This works in Nightly and has for years; it's a little bit klunky but absolutely necessary for using, say, Bypass-Paywalls or Ublock Origin.


I use uBlock Origin in my normal Firefox for Android with no issues at all


It works on beta as well.


Would love to have the ability to save webpage (complete) in Firefox again. Currently I'm using SingleFile/SingleFileZ add-ons (and all the hoops you have to jump through to enable those), but they're a lot slower than Chrome mobile which now has the ability to save a page as .mhtml


I've looked for a way to print to a printer on Firefox mobile but have never found one and always have to switch to Chrome just to print.

Does anyone know if it's possible yet?


I have a Samsung printer and have installed the "Samsung Print Service Plugin" on my phone. From Firefox, I can then share the page with that plugin and it prints.


You can "share" to your print provider (I use Mopria on mine) and it will display a preview of the output.


Just tried it, it works pretty well but some elements are rendered in a weird way. It also seems to not save the mobile version of sites you might see on your screen but adjusts the render size to a more paper-like aspect ratio and size. Still, cool feature!


I still miss the `print` feature. At least Something is better than nothing.


Awesome! This isn't a feature I have a frequent need to use, but it was always disappointing to try to save a page in Firefox for Android and being unable to do so. Now there's one less reason to open Chrome.


Amazing! Just noticed it two days back in mull browser's share context overlay.


Next thing you'll know is that they will bring back RSS ....


Don’t go crazy now. Why should Firefox cater to the power user with a feature that likely requires zero maintenance.

Any day now, I expect them to drop the pretty JSON rendering as well.


I wish there was a browser made exclusively for power users. Something like the Emacs of browsers. I'm tempted to try to make my own like Andreas Kling did.


Is there a similar feature but for taking full page screenshots as well? Using add-ons that do this is unfortunately not allowed on firefox for android.


Neat. Can they un-break everything else now? There's still no way to change the User-Agent.


Thank you so much to those who involved with this update.

Great work as usual.


Chrome has this too. Share > Printer > Save as PDF


Wait I just used this; didn't realize it was new.


It was a feature for years and years. I'm fairly certain I used "print to pdf" fairly often on my very first android phone way back in (2008?)


Yes. It was removed for a while. Now it's back.


Android doesn’t have “print to PDF”?


It absolutely does. I came in here wondering what the difference was compared to the PDF print function.


It does and some apps can share to it. Unfortunately Firefox does not. I just checked.


So odd ... the regression of usability in the 'Preview' app in recent OSX ...

(EDIT: nevermind ... was mis-remembering ...)


No idea what you mean. I'm on Ventura (13.1), just opened Preview and under File there's still 'Export as PDF' alive and well.


You're right - I am not sure what I was (mis)remembering ...

However, I note that "export to pdf" is grayed out for a file that is already a PDF ... which I don't remember being the case ...


It's also grayed out when looking at a PDF on 12.6.2 Monterey but maybe it was how you remember it earlier on?


Why would you want to export a PDF as a PDF? What could that possibly achieve?

Just… use the existing file.


I export a pdf as a pdf all the time ...

You receive a non-editable pdf ... you use the textbox and signature tools in Preview.app to mark it up and sign it ... and then you export it as a pdf to send back.

How else would I complete that workflow ? Genuinely interested ...


You… literally press save.

Preview lets you save any annotations to PDFs and images it supports. It’s literally as easy as pressing Cmd-s. If you really want to save it as a different file, use Preview’s duplicate feature to save it as a new file.

If you want to make the file you’re editing non-editable/flattened, then you can use macOS’s built in print dialog which lets you natively save to PDF. This isn’t a Preview feature per-we, but it is system wide.

This seems to have not been possible before and changed in Big Sur: https://discussions.apple.com/thread/252703055

And Apple’s guide considers Save and Export to PDF to be the same function: https://support.apple.com/guide/preview/annotate-a-pdf-prvw1...


Well, took them ages. Not impressed because the feature is not complete. As of yet, save as PDF cannot save from within the reader view.

I know this is whataboutism but I wish they would have delivered on anti-(canvas-)fingerprinting instead of PDF print.


Seems like people on this site are obsessed with the term "whataboutism" (a rhetorical device used to win arguments which is not being employed here).


Firefox is the only Browser trying to bring desktop sanity to mobile.


Safari has save as pdf in iOS too, press the share button then options at the top.

Chrome on iOS also has save as pdf, have to press share, then print, then the share icon again at the top.


Wow, didn’t know that. You have to chose from options to save as PDF and then the choices will reflect saving as PDF.

I used to use the markup feature as a workaround.


It’s not a Safari thing. Anything you print in iOS can be saved to PDF.


ublock origin and background video fix addons are great


Kiwi Browser has all of these + Chrome engine not causing issues on pages


> Chrome engine not causing issues on pages

is that a theoretical issue because I've never had any problem with page rendering in Firefox, it's been a major for a long time.


Good to know but i need FF sync


Let me add another, Bypass Paywalls


Not available on mobile


You can use it through custom collection which are available on Firefox for Android Nightly and Fennec


It's also been added to Firefox Beta since version 107 (October).

https://www.ghacks.net/2022/10/20/firefox-beta-for-android-n...


For those who couldn't be asked to learn how to "Print to File" I assume?

In fairness, save as PDF is more intuitive, but let's not pretend this is anything other than a UI change for functionality that's always been there. A good one, sure, but nothing more.


how would I print a file on Android?


Print TO file, not print a file. Print TO file is to take a screenshot of a page or document to avoid any interpretation issues later.

To print A file, Android has a generic printer driver and there are more featureful proprietary drivers. I printed a shipping label from my phone over wifi the other day. Very easy to detect and add a printer.

It printed slowly and only printed half the page on the first try, but out of the typical printing experience, that's not too bad.


I don't think you can from Firefox directly: https://github.com/mozilla-mobile/fenix/issues/10217

So, probably save as PDF, then print PDF.


With a network printer for example.


I can't even find a print option on firefox android


It's in the list of options under thr "Share" button


Ah, thanks!


My workflow has been share->print->pdf for many years. Then view through eboox reader synced over google drive across devices. I suggest kiwi browser that has kept chrome plugins.

Mozilla has managed to slip to irrelevancy with a series of Nokia like decisions. Have no idea why pdf export on Android is any kind of news in 2023 but I hope it is interpreted as a return to some sort of right direction.


A few years ago I noticed that a few things would get rasterized when going through the print->pdf process and they would stay vectorized (i.e. higher quality) when using the browser's native PDF export feature.


Yeah, and the "new" Firefox mobile engine (Fenix) that is now probably 2 years old never unblocked extensions officially... unless you go the painful collection route.


OT: i really want to use Firefox on Android, except the scrolling performance really sucks and always has, with every device, every FF version, and every Android version. it is so goddamn janky compared to Chrome and Opera (and i assume other Blink-based browsers). i'm on Android 13 and a top-spec Zenfone 9, so it should be a complete non-issue; it's pretty crazy how bad it still is after all this time :(

unfortunately it's not a minor UX annoyance that you can get used to or simply ignore; it permeates and taints every interaction.

does anyone else have this experience?

EDIT: opened about:support and everything looks fine (webrender, hw accel, hw compositor). interestingly, scrolling the long about:support page is largely jank-free.

EDIT2: went into settings and disabled address-bar hiding on scroll, which seems to have helped quite a bit for web content.


I always used ff on android and never had any scrolling issue. I can't even understand how could that be. I'm using a Samsung s10e with a very bad exynos cpu.


I've been use Firefox for Android on 12 (and 11 before that) just fine, maybe an Android 13 thing? I can't remember the last time I used Chrome, I used Kiwi & Yandex at some points in the past and didn't notice any significant difference). If you are talking about smoothness, it's possible that I missed it, not caring much, but I've definitely never noticed it being so bad it becomes an usability issue.


> If you are talking about smoothness

yes. in 2022 on a top-spec phone and latest OS, scrolling of a static google results page or hacker news thread should not stutter. doesn't seem like an unreasonable ask, imo.


I've been using Android Firefox for years. I've rarely seen a scrolling issues. And those were decidedly not on static pages. Mostly the kind choked with ads.


I've never noticed anything either (and, what ads? That's what uBO is for :) ). And this is on mid tier moto phones.

Maybe someone would have to point it out for me to notice....


I remember trying to switch to Firefox on Android several years ago and encountering exactly the same issue as you - scrolling was just super janky and unusable.

I've recently tried the switch again (a few weeks ago) and did not encounter the same scrolling issues anymore. Could be any number of things that have changed, though, such as a new phone, Firefox updates, OS updates (Pixel 5, Android 13, Firefox 108.1.0).


I'm on a Google Pixel from 2016 and have absolutely no idea what you are talking about. Firefox runs perfectly and I do not see any janky scrolling or otherwise bad performance at all. Scrolling in Chrome does not feel different either.


Pixel 5. Buttery smooth.


I wish there was a good web-based alternative to PDF.


I wish there was a markup language that gave you the full power relatively of PDF, with page sizes and all of that.

And a fairly universal converter to turn that markup language into a document.

Then we could use our pre-existing template systems that we use for all the HTML for PDFs and get rid of all these crazy systems that enterprises used to build all the PDF reports


Why not HTML + CSS?


HTML and CSS are built for web pages, which means they don't really have a strong concept of page size. If I want to build a table with headers that repeat on every page of a printed document, it's an absolute pain to do it with HTML and CSS.

You need something with constructs that can express pages, repeated tables, headers and footers, stuff like that in a much more native format.


Sorry if I wasn’t clear. I didn’t mean “Make it work with HTML and CSS today”. I meant, Why couldn’t HTML and CSS be used as a basis for a PDF-like format? New features are constantly being added to HTML and CSS. In 5 to 10 years, maybe we’ll have a revamped powerful paged layout that will have all the features that you mentioned.

So my point is, why create a new format when you can enhance HTML and CSS?


Nice feature but what is the use case for saving to PDF? If you want to save a web page for later offline reading then epub would be both much easier to implement and more useful given that it retains ability to reflow to fit different screen sizes. Are there good reasons to prefer a non-reflowable format?


A workaround for printing on Android(https://github.com/mozilla-mobile/fenix/issues/10217)


PDF will capture what you see, epub will almost certainly not.


I suspect that PDF is simply a more popular format.


I am using Firefox in Android, these are some of the issues i am facing:

- Scrolling is slow on multiple sites like raycast.com

- The UI doesn't feel home for me, at least it has dark mode on Android 9 (my phone doesnt get updates)

- Tapping new tab doesn't actually create a new tab, instead asks for a URL

- Searching for World cup matches in google only shows the goal score, I guess it's a google search issue, but in chrome I get detailed scorecards

- Tab list view feels janky, why does it automatically switch to another tab, even though I am not closing the current tab? (this happens sometimes)

I will keep using Firefox because Chrome bad.


> Searching for World cup matches in google only shows the goal score, I guess it's a google search issue, but in chrome I get detailed scorecards

Go to settings -> add ons and install "Google search fixer"


Thanks, that fixed it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: