Live data from Hacker News

Pdf2htmlEX – Convert PDF to HTML without losing text or format

github.com

21–30 of 51 posts

Re: Pdf2htmlEX – Convert PDF to HTML without losing text or format

#21

Can anyone recommend an equally good opposite (HTML to PDF)? wkhtmltopdf [0] is probably the most popular, but it's also ridiculously buggy. 0: https://code.google.com/p/wkhtmltopdf/

Not open source, but you might want to check out PrinceXML. It is really good.

Re: Pdf2htmlEX – Convert PDF to HTML without losing text or format

#22
post #20

I didn't see any mention of tables in the doc. Does this means it's outside of the "good enough" range? Table extraction would be a great feature.

It's still a startup, so currently it's focused on accurate rendering, and fast speed(which is not achieved yet so far).

Features about recognition would be planned in the future, usually PDF viewers do not recognize too many things, do they? :)

Re: Pdf2htmlEX – Convert PDF to HTML without losing text or format

#23

Earlier quoted context omitted.

You don't want to rely on the computing power at the client side, do you? :)

I guess one possible setup would be pdf.js running on server-side and having its output captured. One advantage of this, from what I can see, is that there would probably be fewer external dependencies than this setup.

Yes, actually they had this kind of plan, but I am not sure how it has been going.

It would be definitely interesting in that way, but in that case it may not be worth it to rewrite everything in JS.

Re: Pdf2htmlEX – Convert PDF to HTML without losing text or format

#25
post #8

This works and displays correctly, but is unbearably slow on iPad 2 whereas the PDF loads instantly. What is the point then or does it work a lot better in desktop browsers?

The OSX Quartz graphic layer (also used in iOS) uses PDF internally as graphic object model. It is no surprise iOS handles rendering PDF's so quickly and so well and without the need for an third party app, it always has from the release of the first iPhone. This is also why print to PDF is built in on OSX.

I thought it was postscript internally?

Re: Pdf2htmlEX – Convert PDF to HTML without losing text or format

#27

Can anyone recommend an equally good opposite (HTML to PDF)? wkhtmltopdf [0] is probably the most popular, but it's also ridiculously buggy. 0: https://code.google.com/p/wkhtmltopdf/

http://phantomjs.org/ is the best so far in my experience since it handles all the client side javascript properly. The PDF's it outputs are full vector not just rasters, it the same engine used in Chrome to view PDF's and print web pages from my understanding.

We've tried everything, including PrinceXML, and PhantomJS has been the best for us so far.

Re: Pdf2htmlEX – Convert PDF to HTML without losing text or format

#28
I've actually been using this to convert large PDF files to HTML to be displayed in-browser. It's for my work, so I don't feel comfortable posting a link to the demo instance here.

It is definitely the best solution I've found so far. The outputted HTML / CSS / images look almost identical to the source PDF. That being said, there are a few issues still:

* One Gigantic (600kb) CSS file from a single PDF

* Hundreds of individual fonts

* HTML semantics are non-existent

These are all relatively easy to fix, I believe. I have found my own solutions to most of the issues in post-processing.

Kudos to you, coolwanglu. Also, I'd like to get in touch with you about lending a hand to fix some of the issues I've encountered.

Thanks for a cool piece of software!

Re: Pdf2htmlEX – Convert PDF to HTML without losing text or format

#29
post #25
post #8

Earlier quoted context omitted.

The OSX Quartz graphic layer (also used in iOS) uses PDF internally as graphic object model. It is no surprise iOS handles rendering PDF's so quickly and so well and without the need for an third party app, it always has from the release of the first iPhone. This is also why print to PDF is built in on OSX.

I thought it was postscript internally?

NeXT and NeWS were Display Postscript. OS X / Quartz is PDF.

Re: Pdf2htmlEX – Convert PDF to HTML without losing text or format

#30
post #29
post #25

Earlier quoted context omitted.

I thought it was postscript internally?

NeXT and NeWS were Display Postscript. OS X / Quartz is PDF.

It is more accurate to say that both Quartz and PDF (and Postscript) use the same primitives (cubic Beziers, color models, graphic state, etc)

PDF the file format adds many, many things to that (forms, encryption, DRM, notes, a JavaScript engine, reflow information, etc)

Post reply on HN