betatim / notebook-as-pdf

Save Jupyter Notebooks as PDF
BSD 3-Clause "New" or "Revised" License
370 stars 73 forks source link

Make pikepdf dependency optional #2

Closed betatim closed 4 years ago

betatim commented 4 years ago

pikepdf relies on qpdf which means a C++ compiler is needed to install it (I think). This can be tricky on Windows.

There are no Windows packages on conda-forge either.

Maybe it makes sense to make attaching the notebook to the PDF an optional feature to make it easier to install on Windows.

bollwyvl commented 4 years ago

PyPdf2 can also add files.

However, if pike is the way: there is an open issue here for qpdf on conda-forge: https://github.com/conda-forge/qpdf-feedstock/issues/12

Given that both msys2 and msvc builds are documented it seems like a feasible undertaking...

betatim commented 4 years ago

Didn't realise that PyPDF2 was Python only, I somehow had bookmarked it as "uses poppler". I'd be happy to merge a PR that switches to pypdf2 for attaching the notebook to the PDF. Windows compilers and creating conda packages are two things I know nothing about, so that path would be more of a learning experience :D

bollwyvl commented 4 years ago

Yeah, if it wasn't for the pesky 50% of computers that people actually own and touch, I'd ignore windows in a heartbeat! Anyhow: I've taken some faltering steps at it locally, and might be able to PR some time in the future. I'd imagine qpdf/pike is faster than pypdf2 , and when we're "just" talking about notebooks for now, it might not make a big difference, but if, for example, a research paper were to include more of its content (data, bespoke software, trained models) it might make a substantial difference.

Speaking of conda: i'd sure like it if the pyppeteer package actually included the giant, mysterious binary blob of chromium...

anyhow, near term, might indeed PR a pypdf2 cut of it, having done it a few times...