Ask HN: Why has PDF not been replaced with HTML5?

8 points by fakedang ↗ HN
Perhaps the answer is very obvious, but why is it that PDF has not been replaced by the HTML5 format for most on-device documents outside of programming?

Take for instance, company annual reports and pitch slides - you could make the usage of charts and data objects a whole lot more insightful by just giving the option to interact with the charts and choose your data selectively. The same goes for research papers - a small visual gif or video component would go a long way to show things compared to a series of sequential images, as would interactive charts - even the simple ones that you get from Excel.

17 comments

[ 3.3 ms ] story [ 49.1 ms ] thread
PDFs were designed for typesetting, printing, and publishing documents.

"Based on the PostScript language, each PDF file encapsulates a complete description of a fixed-layout flat document, including the text, fonts, vector graphics, raster images and other information needed to display it." Source: https://en.wikipedia.org/wiki/PDF

HTML5 was not designed for typesetting and lacks such features. (For example, HTML does not specify page sizes.)

> PDFs were designed for typesetting, printing, and publishing documents.

That is precisely my question! With increasing prevalence of documents being processed online, why hasn't it been the case that the HTML5 option appears as prevalent as the PDF option in say research articles? I guess a complete phase-out of PDF is not currently possible, but the provision of HTML5 alongside PDF should definitely be possible? I found some online options to convert Word documents to HTML5 too so it's clearly not technically impossible, is it?

PDF is well-known, and [effectively] universal

It's also "fixed" - ie, probably as close to a WYSIWYG format as has ever been created (so far)

HTML5 is ice ... but it's not a 1-for-1 replacement/equivalent

>> With increasing prevalence of documents being processed online, why hasn't it been the case that the HTML5 option appears as prevalent as the PDF option in say research articles?

Many research articles appear in printed journals. If a research publication uses online distribution rather than a printed journal, then perhaps HTML would make more sense.

Traditionally research papers have been distributed as printed magazines and volumes, so PDF has been a common interchange format.

>> I guess a complete phase-out of PDF is not currently possible, but the provision of HTML5 alongside PDF should definitely be possible?

Yes. It in most cases it should be possible, it depends on the use case, target audience, and perhaps the traditions surrounding what is being published.

>> I found some online options to convert Word documents to HTML5 too so it's clearly not technically impossible, is it?

Probably not. It depends on how the documents are originally written and the "expressiveness" of the documents needs. Many research articles are written using TeX or LaTeX (https://en.wikipedia.org/wiki/LaTeX) which, like PDF, was designed for typesetting.

Microsoft Word and most similar modern word processing software will export to both HTML and PDF. Most LaTeX-based systems also support HTML and PDF output. Other word processing and document preparation software may have a range of output and exporting options depending on what it was designed for.

It is more a question of what the target medium (web publishing, printing, ebook formats, etc.) is and what publishing format best fits the document's needs.

Thanks for the extremely detailed response! Although, after reading most of the well-intentioned responses here, I now feel like an idiot.

So I guess it's a matter of preference and medium too, although I felt that were an "HTML5 style" PDF possible, it would have been extremely useful in the fields I've published in. It's certainly better than filling up the page or the slide with a bunch of PNGs.

I addition to thesuperbigfrog's answer [0], PDF files tend to be static, and distributed in such a manner that you don't want them being changed without a relative high level of effort (yes, I know there are PDF editors)

>a small visual gif or video component would go a long way to show things compared to a series of sequential images

Tell me how a small GIF or video is going to work when you print a paper or collect it into a book or journal, please :)

--------

[0] https://news.ycombinator.com/item?id=33787463

I guess I forgot to mention that with the greater prevalence of documents being online (including formal government documents which in fact penalize you for sending them in-paper documents), a lot of printing should not exist and should instead be on phones and tablets.
You may wish there was less printing

It may even be desirable overall

But physical copies of papers, books, etc have a major place in peoples' lives (and will for beyond the foreseeable future) :)

...and gov't forms aren't going to have embedded videos or GIFs ;)

I guess that was my motivation to ask the question. :)

It seems everyone around me (in the developed world) is using a tablet or an iPad or a laptop to read a document, with very little work printed out. I would argue that quite a few government forms for newly created agencies and even tax havens have migrated from plain PDF to forms with embedded JS, for buttons, etc. And with each passing year, books seem to have lesser impact in my life as well as that of my peers - most reading is done on a very portable tablet or desktop. Most reading that is done with a paperback is casual and light. And of course, reading seems to be a dying habit these days.

>And with each passing year, books seem to have lesser impact in my life as well as that of my peers...reading seems to be a dying habit these days.

So sad to hear you and your peers aren't spending reading time with physical copies more! I read more on a screen than physical books/papers/magazines, but appreciate physical copies more with every passing day ...the ability to hand something to someone and tell them "you should read this" is amazing! As is the ability to give/sell what I no longer want ... and to buy what isn't available electronically

Electronic resources are all well and good ... but they lack permanence

For lots of stuff, that's fine

But for something you want/expect to last more than a few hours, week, or years, it's not

I'd much rather augment a physical book with electronic resources (be it a website, QR-linked video, AR, or something not yet invented) than to rely exclusively on ethereal data whose formats are superceded on a frequent basis

Research papers: you want your paper to look the same for everyone. Equations, tables, and many elements of typography need to be preserved among devices. PDF is the only format we have, aside from just distributing images, that does this; HTML certainly does not. It’s a shame, though, that there’s no standard for embedding video that works for everyone.
But these are the same challenges for websites too, right? Layouts have to be preserved as much as is possible, and if that's not possible, adaptive to device OS and conditions. Can you give an example of how HTML5 does not do the task?
Give an example of how HTML5 is better than PDF for universality and consistency :)
HTML never does the task, and is not intended to. HTML/CSS is interpreted and rendered by a browser. It will look different on different devices, with different user settings, user CSS, etc., and with different browsers on the same device, even if the HTML/CSS validates and the rendering engines have no bugs, and even if the HTML author avoids reflow by using a rigid design. This is true just for a plain paragraph of prose. Now add equations, etc. Sometimes this nonuniformity is a benefit, but for some applications you need to control the presentation of your document.
I guess these are the reasons I was looking for. Thanks for taking the time to deal with my noob question. Upvoted!

My next question is that why isn't it possible to agree to a standard presentation of prose and equations for HTML5 which mirrors a clean PDF-style presentation as much as possible (as is done with LateX), but I guess the answer to that is within that xkcd comic about standards.

I don’t think it’s a question of standards. It’s more that HTML and PDF are different things that solve different problems. PDF is supposed to be a static document that looks exactly the same in every compliant PDF reader. A correctly built PDF with have every glyph that it uses embedded, for example. It’s archival, in the sense that it will always look the same, in all future versions of PDF readers. HTML is markup that describes the author’s intentions to the browser. The reader can use his or her own fonts and have other preferences. The text might reflow to fit screens of various sizes. I can read it on my terminal with lynx. You can embed all kinds of resources from the network. One can take heroic measures¹ to force an exact rendering, but, in my opinion, that’s a dead end that hacks a markup system to do what it’s not intended to do.

PDF works great on the web; we don’t need to force HTML to replicate its abilities. It already has hyperlinks, and we can seemlessly navigate bewteen PDF and HTML pages in the browser.

[1] https://github.com/coolwanglu/pdf2htmlEX