12 ms·
Lessons learned from 15 years of SumatraPDF, an open source Windows app (2021)
- andai 4y agoIn terms of making it a web app, easiest way would probably be pcjs, a stripped down tiny linux, and Wine xD
- Idiot_in_Vain 4y agoSumatraPDF is the best PDF reader for Windows
- agubelu 4y agoI use SumatraPDF almost every day and I love it. It is very rare these days to have an application that is all of the following: - Small and fast - Hand-crafted for a particular platform - Not bloated with oddly specific UI menus and configuration settings It has one job and it does it very well. Thank you for it.
- Aisen8010 4y agoSumatra is the best PDF Reader. It's sad that the developer isn't making much money from that excellent product.
- arepublicadoceu 4y agoWhy is it sad? Every time I see a piece of software that provides a lot of value and it’s not focused on money-making (ublock for example) it gives me a warm feeling.
- supriyo-biswas 4y agoBecause there is something ironic about people (in general, including those here) dreaming about well paying jobs, but then wanting high quality products that have been worked on by people without compensation, when that time could have been invested by the worker (developer in this case) working another paid job, spending time with loved ones, and the like.
- GoblinSlayer 4y agoThat's the virtue of suckless software too: you can do it in spare time.
- hulitu 4y agoI don't think that Google, Apple or Microsoft employees are not payed. And the quality of those products just isn't there. I mean, my employer paid 500 euros for an Iphone which maybe costs 50 euros to be produced. From those 450 euros is an Apple engineer not able to test the smalest phone with bigger fonts and to implement proper hyphenation on menu items ?
- rafabulsing 4y agoIt's great that it's not money-focused. It's sad that it doesn't make money despite of that.
- FredPret 4y agoPlease forward your warm feelings to his bank account. Perhaps he can live off it
- arepublicadoceu 4y agoI really forgot for a second where I was, thanks for the reminder.
- xattt 4y agoIt’s missing dark mode that other low-key projects have adopted. It’s an app that’s lovely to use, but it sure does give your eyeballs a suntan when it’s open. Yes, there are custom settings you can set, but for simple software, I just want a simple switch.
- ngneer 4y agoYou can invert colors with a command line option, usually that does the trick
- mikub 4y agoI actually prefer a textfile to change the colors, especially for a pdf reader I don't like white text on the "#000000" black that a lot of apps use. Instead I use "BackgroundColor = #ECECEC" which is much better for the eyes imho.
- TeMPOraL 4y agoWebapps and mobile apps really need two dark modes - the one you like, i.e. light grey text on dark grey background, and another one for AMOLED screens, that's actual light grey or white on pure black. On AMOLED displays, that #000000 not only looks nice, it also saves battery, as it shuts the given pixel off. The difference is substantial - with modern UI trends that waste most of screen space, a "grey on pure black" color scheme can often keep more than 50% of the pixels off! Meanwhile, a typical "grey on grey" dark mode will keep 100% of them on.
- Readerium 4y agoNo AMOLED screens on pure black do not consume significantly less power than a dark non pure black color. The power consumption on pure black vs another dark color is extremely similar. This is because on AMOLED screens individual pixels control themselves and power for off vs dark is very similar. Source: https://www.xda-developers.com/amoled-black-vs-gray-dark-mode/ https://www.xda-developers.com/amoled-black-vs-gray-dark-mod...
- nickjj 4y ago> It is very rare these days to have an application that is all of the following... Yep. On Windows there's: - IrfanView for image editing - foobar2000 for mp3s They've been on my "must have" install list for ~20 years. There's also Ditto for managing multiple clipboard entries. It's a good example of how a small open source tool with an optimized UI for 1 thing ends up being 100x better than the same feature MS tried to implement straight into Windows.
- nix23 4y agoI add 7-Zip and SpeedCrunch to the list
- DeathArrow 4y agoAnd Paint.NET.
- Ambitious1325 4y agoIn your opinion what advantages does Ditto have over win+V? I've only used Ditto very briefly but didn't immediately notice anything too wildly different from the built-in implementation.
- nickjj 4y agoFor a multi-clipboard manager I'm looking for: - Configure hot keys to bring up the clipboard selector (I use CTRL + Alt + V) - Quickly select a clipboard item via hot key, arrow keys or mouse - Search through the list of clipboard items immediately - Configure how many items get saved and when they expire - Ability to paste in plain-text as a separate hot key Ditto hits all of those marks. Overall it feels like it was built by a person who actively uses it.
- Joker_vD 4y agoI use Imagine for image viewing. It has an amazing little feature: when you press the "Next Image" (or "Previous Image") button and the window resizes/moves to keep its size consistent with the new image's size, the mouse cursor is automatically moved to still be over that "Next"/"Previous" button. It most likely takes about 5 lines of code to implement but what's important that the author actually thought about and took care about this scenario.
- krylon 4y agoI haven't touched a Windows system in a few years, but when I worked as a Windows admin / programmer, SumatraPDF was my PDF viewer of choice. It does what it's supposed to do, does it well, and it doesn't get in my way while doing so. No subscription or cloud bullshit. And like you said, it's really small and fast. To top it all off, it runs without an installer, you just drop the executable somewhere and you're good to go; so people can use it without having Administrator access or bothering / arguing with their IT department.
- KingOfCoders 4y agoLove love love it, using it all the time.
- sammy2255 4y agoSumatra is one of the first things I install on new Windows setups. Something refreshing about having PDFs open instantly. Screw adobe. Microsoft Edge meets my needs when it comes to PDF signing
- Semaphor 4y agoNeeds (2021). Discussed at the time (133 comments): https://news.ycombinator.com/item?id=27968900 https://news.ycombinator.com/item?id=27968900
- dang 4y agoThanks! Macroexpanded: SumatraPDF 3.4 Released - https://news.ycombinator.com/item?id=31566401 https://news.ycombinator.com/item?id=31566401 - May 2022 (79 comments) Lessons learned from 15 years of SumatraPDF, an open source Windows app - https://news.ycombinator.com/item?id=27968900 https://news.ycombinator.com/item?id=27968900 - July 2021 (133 comments) Lessons learned from 15 years of SumatraPDF, an open source Windows app - https://news.ycombinator.com/item?id=27963298 https://news.ycombinator.com/item?id=27963298 - July 2021 (4 comments) Sumatra PDF Is a PDF, ePub, MOBI, CHM, XPS, DjVu, CBZ, CBR Reader for Windows - https://news.ycombinator.com/item?id=27589337 https://news.ycombinator.com/item?id=27589337 - June 2021 (2 comments)
- greggsy 4y agoI haven’t it since Chrome was big. Does it have allow searching by folder yet? It’s the killer feature that I need in Acrobat
- isaacfrond 4y agoJust installed it. It's crazy fast.
- RheingoldRiver 4y agoI installed this on a whim a long time ago, thinking I was getting a mediocre pdf reader. Little did I know, I was getting a fantastic pdf reader that I would continue using for many, many years to come. I recommend it to anyone unsure what pdf reader to get. Here's to another many years!
- app4soft 4y ago[flagged]
- DharmaPolice 4y agoI agree with his points about treating it like commercial software (in terms of having a website/screenshots/etc) but paradoxically the more professional an open source site looks, the more I assume there's going to be a catch. When you find a utility which has a site that looks like Richard Stallman's website you breathe easily because it's unlikely there's going to be any time-limited trial version, subscription models, ads-in-application, etc.
- netr0ute 4y agoAlthough this may be true for you, as shown by SumatraPDF, this is probably a characteristic of only a small demographic.
- thejosh 4y agoPDF readers are probably the opposite for the target demographic, given it's for Windows. It's a great reader last time I used it. But agreed, many forget certain programs/tools/etc don't need to be actively to be updated once they just "work". Unless it's been rewritten in Rust, or if it's slightly older Go ;-).
- acuozzo 4y ago> but paradoxically the more professional an open source site looks, the more I assume there's going to be a catch I hate to admit this, but I feel the same way when it comes to programmers themselves. I've tried very, very hard to be mindful of this in an effort to correct it, but I still have this gut feeling when I encounter a fellow programmer with the general put-together-ness of someone in the C-suite. What makes it worse is that I've had this gut feeling validated several times in the past. I once worked with a very cover-of-GQ programmer who, after ten+ years in the industry, would struggle with FizzBuzz-esque problems.
- sph 4y agoLikewise, I'd never trust a software engineer in a suit, unless it's for a project written in Java or COBOL. Nor a sysadmin that isn't wearing black, running Linux and/or listening to metal. Unless they have a white beard, then you know they have been around for a while. (Just partially serious here, don't read too much into it. But you know it's true.)
- deleted 4y ago[deleted]
- _hao 4y agoThis makes for a quite compelling case relating to the Casey Muratori video around clean code that made the tech community rounds recently. The developer of SumatraPDF has rolled his own implementations for a lot of things in order to reduce bloat and it shows! The app is lightning fast and does its job perfectly. Wish we had more native projects like that!
- mananaysiempre 4y agoNotably, the roll-your-own parts do not include core PDF parsing and rendering, which are outsourced to (possibly a fork of?) mupdf.
- hedora 4y agoThis makes sense. PDF is (was originally) a stripped down version of postscript, and postscript ran well on embedded processors by the late 80’s.
- tormeh 4y agoMupdf is the key. Sadly there's no user-friendly mupdf wrapper like Sumatra on Linux.
- olddustytrail 4y agoWhat about zathura mentioned upthread?
- tormeh 4y agoDoesn't have a ToC sidebar, which I consider pretty much the absolute minimum of GUI necessary. You can use a keyboard-driven menu by pressing tab, but in my experience it just takes you to the last page of the pdf. Maybe there's a bug or maybe it's user error. Regardless, this isn't what I'm looking for.
- badpun 4y ago100% agreed! I’ve switched go Sumatra PDF roughly 5 years ago, after Adobe Reader became just absurdly slow. It’s crazy how a hobbyist can make product that’s vastly better than a multibillion dollar company.
- melagonster 4y agoyes, I want to use this everywhere.
- adql 4y ago> This comes back to Jeff Bezos' wisdom: there will never be a time when users want bloated and slow apps so being small and fast is a permanent advantage. Did he share that with rest of the company or kept the knowledge to himself ?
- pavon 4y agoHe said it specifically about fast shipping, the SumatraPDF author extended the analogy to software. > In our retail business, we know that customers want low prices, and I know that's going to be true 10 years from now. They want fast delivery; they want vast selection.[1] [1]https://www.goodreads.com/quotes/966699-i-very-frequently-get-the-question-what-s-going-to-change https://www.goodreads.com/quotes/966699-i-very-frequently-ge...
- foul 4y agoDidn't know that the SumatraPDF author had a blog, loved the read
- taneq 4y agoBeen using SumatraPDF for probably a decade now and it’s always been great. Thanks, Chris! If there’s one feature I’d absolutely love, because it’d let me delete Acrobat Reader again, it’d be digital signatures. Clients demanding that documents be digitally signed (but self-issued certs were ok?!) was the only reason I grudgingly reinstated it on one of my machines.
- tpoacher 4y ago> I learned about how Plan 9 C code had non-traditional scheme of #include files where they don't put #ifdef wrappers in each .h file to allow multiple inclusion and .h files don't include other .h files. As a result .c files have to include every .h file they need and in the right order. It's a bit of a pain and no other modern C++ codebase I know of maintains such discipline. I've always thought this is exactly how headers should be treated. Effectively they should be interfaces importing functionality locally, and each header should make it explicit what is imported from name alone.
- mananaysiempre 4y agoThe problem with this scheme is that adding a dependency to a header now breaks source compatibility (even if nothing new needs to be linked in and a piece of a library just needs to pull in a different piece of itself or even of libc). It’s pretty and clean, but you need an environment that’s friendly to crosscutting changes to handle source-compat breakage. (Such as, yes, a dependency-tree leaf like an end-user application, or a monolithic tree like a traditional Unix.)
- kvnnews 4y agoYou can accomplish most of this by using forward declarations and the pimpl idiom as Scott Meyers recommends. Performance can be greatly improved with precompiled headers. Headers without pragmas or ifdef's sounds like masochism.
- haunter 4y agoSumatraPDF, JPEGView [0], ShareX [1] are some great Windows open source softwares 0, https://github.com/sylikc/jpegview https://github.com/sylikc/jpegview 1, https://getsharex.com/ https://getsharex.com/ ShareX is the nr1 software I wish was available under Linux. It does so much and perfectly. But I guess the whole X11/Wayland + different UI toolkits makes it complicated.
- _dain_ 4y agoDon't forget Notepad++. And honourable mention: voidtools Everything. It's freeware, not open-source, but it's the best search utility for Windows around. It beats the Windows Explorer / startmenu built-in search on every single axis, to a comical degree.
- sundarurfriend 4y agoWhat features of ShareX do you use in practice? I came across it around the end of my Windows usage (a few years ago), and the only thing I really found useful was the Upload feature to get an Imgur (or similar) link.
- haunter 4y agoMaking screenshots, screen recording (small gifs or video files), sharing the files, color picking, basic image editing, video converting, OCR from scanned documents. So a lot
- cinntaile 4y agoI use it, it's fast and it does its job well. It looks kind of plain compared to more modern looking applications, but that's probably contributing to its speed advantage.
- jesuslop 4y agoLater versions have annotation (review tools) support.
- bluedino 4y agoAfter Foxit started to imitate the worst parts of Adobe Acrobat Reader, I re-discovered SumatraPDF. What a refreshing piece of software to use, the lack of bullshit is amazing. Of course, it's blocked at work so I can't use it on my Windows machine.
- slurpyb 4y agoI’ve unfortunately fallen into Calibre. Only because many years ago I had issues with SunatraPDF. Calibre is….. just strangest software. I still fumble around with it and it gets super slow. Great read thank you
- iafiaf 4y agoWhile we are at it, a small shout-out to PDF X-Change Viewer/Editor. Best part for me is that it works on Linux (via Wine) and Windows.
- snielson 4y agoYes, PDF-XChange is the best pdf software.
- yodon 4y agoI'll add a shout out to Paint.NET here. Couldn't live without it.
- EarthIsHome 4y agoI've been very happy using SumatraPDF on Windows, because it redraws the PDF after the file has been written over. (This is especially useful with LaTeX on Windows.) When I have the PDF open with Adobe Acrobat, my LaTeX compiler can't write over the open PDF file.
- rags2riches 4y agoThis use case led me to Sumatra as well. Haven't used another pdf reader on Windows since.
- eirikbakke 4y agoThis is exactly my use case for SumatraPDF as well; seamlessly refresh a PDF that's been regenerated from LaTeX.
- noirscape 4y agoSimplicity vs Customizability is something I wish more software in general understood. FOSS in particular tends to lean into the Customizability aspect far too much; I'm a big fan of it, but it took (for example) GIMP years to actually shift it's interface to being single-window by default and making it less easy to close the default side-panels (which unless you knew how those were put together were also basically impossible to get back, so the thing most people did was either stop using GIMP or wipe their installation, hoping that a reinstall would restore the windows). A lot of that comes down to the rather... weird relationship FOSS has with depreciation; most projects will gladly break people's workflows because "it's just better to do it that way" and at the same time, you have some obscure workflow nobody but the dev who wrote it still relies on, so you can't update a default that should have been changed 3 years ago because then they start complaining (and usually gets to keep the defaults fucked because of project seniority, which in my experience tends to matter far more than anything else in FOSS projects). There's a balance to keeping things simple with the advanced tools needing to be deliberately sought out. SumatraPDF in my experience manages to walk that balance very well. It's the kind of software where just using it feels intuitive; I've been able to let elderly people install it and use it without needing to spend hours educating them on how it works. It just shows documents and the basic icons make immediate sense. (On the other extreme end, proprietary software can come across as almost completely nannying nowadays to the point where I stop using it because I feel like I'm getting lectured like I'm a 5 year old. Again, there should be a balance.)
- gorjusborg 4y agoI find it interesting that he repeats the mantra 'be like water', which seems to partially equate to 'give users what they want', while also discussing the mozilla/firefox history. It hints at what I think is a natural cycle of software. Software evolves with its user base, its existence and modification over time proving its value. Then, there comes a time where the weight of its history (and feature set) becomes too much of a burden to its current user base. At that point, something happens to shed the weight.
- hedora 4y agoI think the weight comes from expanding teams and developer turnover. Small teams can avoid both these issues.
- kjksf 4y agoSumatraPDF author here. Glad people like the software for the reasons I thought the would (small, fast). If you haven't already: use Ctrl + K (Command Palette), a better way to operate the program than menus etc. Also I'll plug my latest project: I "ported" notepad2 to web: https://onlinetool.io/notepad2/ https://onlinetool.io/notepad2/ It's 85% done i.e. some functions are not implemented. On Chrome / Edge it can even read / write files from your computer (needs File System API). Otherwise files are stored in the browser in IndexedDB. Not sure if it makes sense but here it is.
- anta40 4y agoI rarely use SumatraPDF because I often switch Mac-Windows. That said, I certainly appreciate small fast software, e.g uTorrent. It's small because it's Windows only, and very likely avoid cross platform libs and rewrite everything on their own. For writing personal project, I agree cross platform my be over-rated. Just stick to your favorite platform. Make it works and optimized.
- Macha 4y agoI guess you're talking the uTorrent of over a decade ago? Even on Windows I ditched it for deluge some time ago.
- ismokedoinks 4y agoHey just wanted to say I use your app for all my reading, both school and recreational. Having a good desktop ebook interface has probably 5-10x how much I usually read over the last year--thanks for that!
- tavorep 4y agoI only wish I could highlight ebooks
- chafporte 4y agoplease add viewing of 2 pages side by side.
- anta40 4y ago>> The only way for one person to even attempt cross-platform app is to use a UI abstraction layer like Qt, WxWidgets or Gtk. The problem is that Gtk is ugly, Qt is extremely bloated and WxWidgets barely works. So, how you are going to write cross platform apps, then? :D
- Ergo19 4y agoDo like everybody else does and wrap it in a web-browser.
- hedora 4y agoDoes wine have the ability to package windows binaries? That would probably be lighter weight, assuming it performed a tree shaking pass.
- billfruit 4y agoJava is still viable for many usecases.
- throwaway2037 4y agoIt is the first time I heard that Qt was bloated. Is this true? If so, I would like to know what other UI toolkits do that is less bloated.
- GoblinSlayer 4y agoPut UI behind PAL like sumatra does with pdf engine.
- dadoum 4y agoYou can implement the frontend separately for each platform, which is used by example by usbimager, Transmission or SciTE. This is very hard to do in practice for any big enough software, but then using Qt, Java or C# frameworks is probably worth it since their impact will start to be small compared to your application footprint.
- planede 4y ago> memory leaks. It's surprisingly hard to find an easy to use memory leak detection tool. I can vouch for heaptrack[1] nowadays, although it's pretty much Linux only. It's under the umbrella of KDE, but a heaptrack trace only requires a CLI app, and there is a nice Qt viewer to analyse the memory consumption. It tracks the memory utilization at the level of malloc'd/free'd bytes. It's fine if your memory leak or other memory utilization problem is on this level. Recently I dealt with an issue, where increasing memory utilization was caused by fragmentation within the allocator. This didn't show up in heaptrack as an increasing memory utilization, but heaptrack still pointed out where most of the temporary allocations happened, leading to the culprit of the fragmentation. [1] https://github.com/KDE/heaptrack https://github.com/KDE/heaptrack
- hedora 4y agoC++ leak trackers are surprisingly easy to implement. You create a custom allocator that has a per-type pointer to a pair of static ints (one for allocation count, one for total size). When the allocator is statically instantiated, it adds itself to a global list. Periodically (and at shutdown) log the top N heavy hitter allocations. In testing, assert there are no outstanding allocations in a static destructor. The overhead of this is a couple of increments / decrements per allocation / free, so you can probably leave it on in production builds.
- throwaway2037 4y agoDo you have an open source library or reference code to share? It sounds like a good idea.
- theloco 4y agoI like it! "If you're not embarrassed by your app then you've waited too long to release it"
- Aloha 4y agoThis is exactly the thing I've been looking for! I have a powershell script that downloads PDF's from a URL, and prints them to a specified printer, I'm using Foxit right now, however there have been substantive changes to foxit, and I'm worried about the free option going away. I'll for sure check this out.
- WhyNotHugo 4y agoI think it makes perfect sense for this to be windows-only, and it wouldn't make sense to make it cross-platform. Make a PDF library cross platform? Perfect sense. Make a PDF reader cross platform? You'll end up with a mess. The reader itself is mostly the UI an interacts with the OS's API for rendering and drawing. There's really no way to write one that works on different OSs unless you either have three separate codebases. Or you can hide three separate codebases under some abstraction that makes the application look alien on all supported platforms.
- jcpham2 4y agoI actually remember having to locate SumatraPDF for an attorney's Palm so he could open and view .pdf files from his email. I don't know if anyone remembers this but Exchange ActiveSync debuted around 2003 Blackberry had their own standalone solution that was a whole slew of Windows services and service accounts integrated with your Exchange server.
- sebow 4y agoSumatraPDF is great, only wish it had 2 more things: Dark mode(or 'invert' mode, really) and a working Linux binary (I know about wine, still...).
- wpietri 4y ago"Getting early users, learning what features they want the most beats toiling for months or years and implementing lots of features before you know anyone even cares." Yes, yes, yes. I wasted far too much of my life building things that nobody actually cared about because some executives spent far too long in conference rooms huffing each other's farts and creating product plans that were bigger fantasies than anything Tolkein ever wrote. And I'm not even mad about the bullshit, really. By all means create the fantasy-filled documents if that's what it takes to get funding/approval. The part that kills me is when people start believing their own bullshit. Dream big but work small. And then ship! Close those feedback loops.
- j0e1 4y ago> But try to make a nuanced point about more tests vs. more code to your fellow developers and you'll be burned at stake and your smoldering carcass will be thrown to wild dogs. Village children will use your severed head to play soccer.
- DeathArrow 4y agoWow, someone that didn't use Electron for writing desktop apps? Focus on speed and simplicity? Basically every app should be like this.
- jmg_ 4y agoFunnily, more than a few Electron apps use SumatraPDF under the hood: https://github.com/artiebits/pdf-to-printer/blob/master/src/print/print.ts#L28:L37 https://github.com/artiebits/pdf-to-printer/blob/master/src/...
- rwalle 4y agoYeah, "should", when every app developer decides that they should use Win32 API.
- YounesDz 4y ago> It's about 127k lines of C++ (not counting libraries written by others) I admire and respect you for that. Thank you really for building SumatraPDF.
- JALTU 4y agoAnother thank you shout out for @kjksf. Long live SumatraPDF!
- retrofeel 4y ago[dead]
- piokoch 4y agoI have open a few bigger PDF files with Sumatra. It is insanely fast, it starts insanely fast. Or maybe Sumatra is just normal, we got used to dealing with crappy, slow, bloated software "because RAM and CPU is cheap" and forgot that stuff can work so good.
- ilrwbwrkhv 4y agoExactly like all the slow software built on React Native.
- MichaMeier 4y agoWorks great for me even in Linux via Wine.
- rldjbpin 4y agoglad i read this, even if two years too late. there are some points that people excited by the cutting-edge would not like, but it totally makes sense.
- garfieldnate 4y ago>It prevents circular dependencies between .h files and doesn't inflate C++ build times because of careless including the same files over and over again. Ah, the C/C++ modularity story is such a monstrosity... but modules are coming, and the build times are drastically decreased.
- bigthymer 4y agoWhat is the best PDF viewer app on Mac that is closest to Sumatra?
- wonrax 4y ago> This requires resolve. I constantly get requests to add more icons to the toolbar and I constantly have to say “no” because adding 2 more icons to the toolbar to satisfy 10% of users makes the app slightly worse for 100% of the users. This, this is why I love the app. Adobe Acrobat has more pleasing GUI but it clutters with buttons and sidebars and functionalities that I'll never use most of the time but they consume most of the screen real estate. When reading, I'd like everything to get out of the way and let me focus on the content, SumatraPDF serves me well.
- 732riuhfaieji 4y agoSumatra does not support PDF forms
- rwalle 4y agoVery interesting article. Has a lot of good, practical points. But I cannot help but wondering -- the author keeps saying "This is my project so I can do what I think is the best choice", but how many of these principles would break down if the original authors stop maintaining this, and other people take over/fork the project? The I can totally understand why the author created their own JSON/XML parser, but another person may consider it too complex/not practical/no longer worth the effort and instead replace it with a small library. What happens from there?