Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] pdf generation #16

Merged
merged 23 commits into from
Nov 28, 2015
Merged

[wip] pdf generation #16

merged 23 commits into from
Nov 28, 2015

Conversation

bollwyvl
Copy link
Contributor

This is the current state of the pdf work. It's pretty raw.

I am trying ghost.py instead of phantom: it's a more robust, as it doesn't bundle all of qt, but more about that below, and gives us better access to the underlying components of qt. it's error handling is not as good as phantomjs, though.

It stands up a temporary tornado server, and uses a long task outside the event loop which then kills the event loop when done.

I am getting some fascinating js errors that are heisenbergingly absent when run "full-local", i.e. no network access, but i am slowly but surely finding my way there through a mountain of undefined(0): undefiend is not a function-style errors.

Features

  • multipage PDF generation
  • attach raw ipynb to PDF
  • per-page orientation, size
  • easily install (work covered by Anaconda-Server/Anaconda-Notebook#43)
    • pyqt (seems pretty good)
    • ghost.py
    • pypdf2
  • in-notebook app download
  • verify third-party integration
    • bokeh
    • bqplot works fine in app, but is made of widgets...
    • qgrid (master?)
  • "true" offline generation (can't help what third-parties do) - may be deferred

Roadblocks

I am not trying to hit the widgets yet! That will probably have to wait until pyqt5 is usable with ghost

@bollwyvl
Copy link
Contributor Author

Here's the kind of thing I'm getting out right now :)
output.pdf

@bollwyvl bollwyvl mentioned this pull request Nov 17, 2015
@bollwyvl
Copy link
Contributor Author

The loading problem is due to baobab... maybe something isn't shimmed properly...

@bollwyvl
Copy link
Contributor Author

Yep. The issue was creaky old PyQt's webview didn't have the Function.prototype.bind defined, which was exploding in ghost. Would have happened over in phantom, too, though I might have found it much more quickly.

Output is getting a lot better:
output.pdf

I am going to do some other tests to ensure it's not cheating, but I'm confident it will be demoable now.

@bollwyvl
Copy link
Contributor Author

The examples are looking better!

@bollwyvl
Copy link
Contributor Author

Ok, really pretty ready to be done with this. nbbrowserpdf is in -c nbcio. I'm going to merge this, and we can pick up the shiny pieces if the nbpresent build is not good.

bollwyvl added a commit that referenced this pull request Nov 28, 2015
pdf generation, mostly deferred to nbbrowserpdf
@bollwyvl bollwyvl merged commit 6c78f6f into master Nov 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants