-
-
Notifications
You must be signed in to change notification settings - Fork 417
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
Print to PDF #127
Comments
It should be possible, and it fact, it should work... I will try to investigate soon. |
I am also interested in this What is the easiest way to print to pdf for slides created via RISE? I try the following: jupyter ipnyb -> slides (via rise) -> print to pdf (using chrome print options) However, result is: only the currently active slide is printed Any advice for simplest way to convert slides to pdf? |
Any advice for simplest way to convert slides to pdf? Probably using nbconvert and then |
Damian, I'd love to make this work too. I tried to use your instructions above but I'm not sure I'm following. What are the steps needed if I have a notebook on my windows box at "C:\MyDir\MyNotebook.ipynb"? |
I managed to figure it out after more testing, thought I'd leave the instructions here:
|
Thanks for the detailed step @aaronbarzilai |
@aaronbarzilai thank you, thank you!. Im still struggling with this. I get the error below when i try to follow your steps, is there something obvious I should check or configure (im not familiar with nbconvert) OSError: [WinError 10048] Only one usage of each socket address (protocol/networ |
Version 46.0.2490.86 m As far as I can tell it is respecting the slide limits, but I'm just Thanks, On Tue, Nov 24, 2015 at 2:32 PM, Damián Avila notifications@github.com
|
I was receiving this error: "[WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted" So, inspired by this issue, jupyter/nbconvert#102 (comment) Now I do see the webpage in the browser (hooray!) but still have several issues (boo)
I also see several of these types of errors in the console: My questions:
Any advice gratefully received to learn how to print to PDF. |
my workflow:
Are there any ideas how can those two can be fixed? EDIT: of course it would be nicer if one could just append '?print-pdf' to the URL generated as one presses 'livereveal' slideshow button in jupyter toolbar. |
@anaderi thank you, thank you! My workflow (with Anaconda 3.4):
Then chrome can print PDF of all slides as they appear in HTML slides. My questions for anyone more knowledgeable:
Apologies if these are basic questions |
(a couple of months later) @damianavila, do you think there are any chance this one would be resolved soon? |
You mean print-pdf from the slideshow view? Regrettably, currently, I almost don't have time to make it work... but it is in my top priority to check this again when I have some time available... |
maybe summer will promise a glimpse of a free time for this issue? ) |
Maybe... 😉 |
meanwhile ... I've managed to merry RISE with decktape. works reasonably well. |
That's great to know... Printing PDF from HTML slides was always a nightmare... I am happy to instruct people to use other packages if the resulting pdf quality is something reasonable. |
I have a private example (research I'm not allowed to share). If you give me link to a RISE-enabled notebook with reasonable dependencies , I'll send you the link to the slides |
OK, I will do that... and post the link here and I will ping you... |
JFYI, the PR has been accepted and it is part of |
Thanks for the ping @anaderi |
@anaderi I tried your decktape solution, looks very promising, but I get a ReferenceError that phantomjs can't find variable Reveal. Did I miss a step in the setup? ./bin/phantomjs.exe decktape.js rise http://localhost:8888/notebooks/test_slides.ipynb#/slide-0-0 test2.pdf |
I hit the same issue as @shortcipher3 this morning as well. |
@shortcipher3 @ssanderson would that be possible for you to increase the delay here: https://github.com/astefanutti/decktape/blob/18d1e1537fe85c7d5cd9cdaa4f46184eda7241b0/plugins/rise.js#L36 and give it a try? It may be that it takes a bit more time for Reveal.js to initialise depending on your setup. |
So I was able to do render it. For others who also found this issue like me, wanting to render a pdf, here is what I did:
Possible Problems:
Enjoy! |
One problem I experienced which is worth mentioning separately is that the fragments don't show up at all. The current decktape rise plugin puts Work Around:When changing the above line to |
Thanks for all this info @schlichtanders |
I'm getting the same "ReferenceError: Can't find variable: Reveal" and am stuck. How did everyone get this to work? What might I be doing wrong? |
Have you added token information in the url. as suggested by @schlichtanders |
Maybe there's a way to use Headless Chrome to visit each slide, print to pdf (using the |
It could be probably a nice idea to test. |
Not sure if this has been addressed, but I've been struggling to get colours in custom.css to display when printing to pdf. It turns out the twitter bootstrap styles are dropping in print CSS that sets a bunch of things with !important, so it's necessary to flag as !important anything you're putting into custom.css @media print {
*,
*:before,
*:after {
background: transparent !important;
color: #000 !important;
box-shadow: none !important;
text-shadow: none !important;
}
... } |
Thanks for the note @lucasdurand (this is probably something to fix upstream, in the notebook css itself). |
You're absolutely right @damianavila. It's actually set in the notebook css file. Somewhere around here: |
@thallada, @schlichtanders, all, DeckTape 2.x now uses headless Chrome and has been updated to support RISE 5.x. |
Thanks for the info @astefanutti! |
Hi @damianavila, is there now a section in the docs explaining how to print to PDF like this? I tried installing DeckTape, but wasn't able to get it working, and it would be great to see a step by step example of doing so. I love RISE, but I also need to be able to share a PDF with people after the talk... |
There is not any reference in the docs about this.
Those are the alternatives, but we need to validate all of them. |
I have been using 3 for a few months now successfully. It produces reasonable PDFs as long as you restrict the amount of information on a slide, much less forgiving than the "live slides" view with Reveal. |
I just used @aaronbarzilai method #127 (comment) (see https://twitter.com/astrojuanlu/status/912178600916353024) but the syntax highlighting doesn't work. Does it happen to anyone else? Is there a quick workaround? If not, I will try DeckTape. |
(note: adding |
Howdy all, the print issue was solved in notebook master (jupyter/notebook#3212). We should see fix in our land soon (as soon as we have a new notebook release). |
I tried this with notebook 5.4.0, which should contain the fix, and all the code is still black. But I guess this is not a problem in RISE... |
This needs to be propagated to the CDN from where nbconvert is fetching the css: jupyter/nbconvert#747. |
@lucasdurand @schlichtanders I have written your recommendations in the docs, thanks for testing those options and share them. |
thank you too! |
Cheers! This was a wild ride |
Reveal.js supports the following option :
Open your presentation with print-pdf included anywhere in the query string. This triggers the default index HTML to load the PDF print stylesheet (css/print/pdf.css). You can test this with lab.hakim.se/reveal-js?print-pdf.
ref: https://github.com/hakimel/reveal.js/
I tried adding ?print-pdf to my ipnb url but it does not work.
I was wondering if it was possible to enable it with RISE. This way I can make handouts for students.
The text was updated successfully, but these errors were encountered: