Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

weird, my Alfa Romeo user manual is 270 pages filled with graphics (literally, they are jpeg scanned to a pdf) and loads instantly even on my mobile phone


The first page is rendered instantly you mean. PDF, at least when generated by a sane generator, can be parsed pagewise. HTML cannot, you always have to parse everything in a page to do layout, because later objects can change or overlay earlier ones.


This is being partly addressed in the latest draft CSS specifications...

https://news.ycombinator.com/item?id=24093273


> HTML cannot, you always have to parse everything in a page to do layout, because later objects can change or overlay earlier ones.

HTML is progressively rendered by default. This has been a feature since Netscape 1.0! It is only if you use certain types of layout this is not possible. For example an adaptive table have to be fully loaded before the width of the columns can be calculated.


And it was a very important feature too, back when internet was slow.



Is PDF still unstreamable? AFAIK, the TOC (catalog?) in a PDF was located at the end of the file, meaning the whole PDF had to come down in order to parse the PDF. (With the exception of the first page, as you say — some aspect of the PDF spec allowed for a self-contained page 1.)


Linearized PDF has existed as a concept since v1.2 which I think was released in 1996.

You can see it mentioned in the v1.4 spec at https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/pd... [follow the link from the contents].


There are libraries to linearize PDFs but not all PDFs can be converted. Some of the more popular open source PDF libraries do not support it though.




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

Search: