4 ms·
Somebody please package the html into a pdf!
by dandermotj 11y ago
Somebody please package the html into a pdf!
- bootload 11y ago"Can I get a PDF of this book? No, our contract with MIT Press forbids distribution of too easily copied electronic formats of the book."
- whatok 11y agoI was able to print to PDF in Chrome and combined the PDFs in Acrobat.
- TheCabin 11y agoI guess this could be automated. For instance, you could download all html files using a plugin like "Download Them All" with a renaming mask like "inum-nameinum.ext" and then try: find . -iname '*.html' -exec wkhtmltopdf {} {}.pdf \; There are also tools to convert the resulting files to a single pdf. The only problem I got is, that the woff fonts are not rendered by "wkhtmltopdf" :-/ Ideas?
- cced 11y agoThis type of thing is what gets people thinking about a way around the no-pdf solution.
- thinkMOAR 11y agoWhat does the contract say about 3rd parties wrapping it in PDF?
- dandermotj 11y agoLook, I'm not planning on printing the whole thing, binding it and sticking it on my shelf. I want the pdf because then I can use it when I'm offline, across devices and search it easily. If I want this book in hard copy, then I will purchase it - I've done this regularly with free digital books - but when it is offered free digitally then in my opinion prohibiting to only certain file formats is futile (as evidenced here), and such constraints are ineffective attempts to encourage people to buy the hard copy through inconvenience. And I must add that this is no slight to the authors, whom have my greatest appreciation for compiling their vast knowledge into a book and offering it for free. These guys are legends.
- bootload 11y ago@dandermotj I understand that, just included the reason why you cannot get it. The online book really sucks. I turned the styling off.
- ing33k 11y agoin google chrome you can do a control + p ( print ) and save as pdf
- newman314 11y agoLiterally, the first link is a link to a pdf version (granted it's probably not quite intuitive). For the lazy: http://www.deeplearningbook.org/front_matter.pdf http://www.deeplearningbook.org/front_matter.pdf Personally, I was looking for an ePub version but no biggie.
- etiam 11y agoHacky solution: On a suitably equipped unix-like system one might... mkdir dlbook;cd dlbook;wget --recursive --level=1 http://www.deeplearningbook.org/ cd www.deeplearningbook.org/contents python import pdfkit pdfkit.from_file( ["TOC.html","acknowledgements.html","notation.html","intro.html","part_basics.html","linear_algebra.html","prob.html","numerical.html","ml.html","part_practical.html","mlp.html","regularization.html","optimization.html","convnets.html","rnn.html","guidelines.html","applications.html","part_research.html","linear_factors.html","autoencoders.html","representation.html","graphical_models.html","monte_carlo.html","partition.html","inference.html","generative_models.html","bib.html","index-.html"], "Goodfellow-et-al-2016-Book.pdf") Better solutions? edit: changed ".pdf" from a slightly longer approach to ".html" which actually exists in this workflow. Thanks @TheCabin! edit(2): ... and gave a valid path to this listdir. Check before I post... check before I post... edit(3): ... and removed the os.listdir line no longer needed in this approach. Gosh. Just ignore what I was saying and build your own approach. That'll probably be faster at this rate. edit(4): Don't import os without using it.
- TheCabin 11y agoThis isn't working, is it? Where is the script supposed to get the files ..., linear_algebra.pdf,... from?
- etiam 11y agoAbsolutely right. That's erroneously copied from converting each HTML file separately with the intention to merge afterwards. Thank you for pointing that out!
- yorwba 11y agoJust found this gist: https://gist.github.com/luoyetx/a44eea84272123f608dcf737588cdfa7 https://gist.github.com/luoyetx/a44eea84272123f608dcf737588c... Avoids the awkward file system structure by using pdfkit.from_url, but creates one .pdf for each chapter. I tried using a list of urls, but pdfkit failed because my version of wkhtmltopdf did not accept multiple input files. Edit: pdfkit.from_file also fails on my system when passing multiple files. If that works for you, multiple urls are probably fine, too.
- plingamp 11y agoSaving as PDF was not working on OSX Chrome. However, using Safari with "show no footers" option, generated a perfect PDF.