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

Export Annotated Slide Deck to PDF #1868

Closed
paul-sheridan opened this issue Aug 14, 2022 · 13 comments
Closed

Export Annotated Slide Deck to PDF #1868

paul-sheridan opened this issue Aug 14, 2022 · 13 comments
Assignees
Milestone

Comments

@paul-sheridan
Copy link

paul-sheridan commented Aug 14, 2022

How can I export to PDF a slide deck that has been annotated with the chalkboard pen tool?

I followed the instructions to print to PDF using Chrome as described in the Guide.

Here is a test annotation on the Quarto Demo Deck title slide:
screenshot-1

Here what I get when attempting to print to PDF in Chrome:
screenshot-2

It would seem that the annotation is being handled properly, but not the slide contents themselves.

Any suggestions?

@jjallaire
Copy link
Collaborator

I don't believe this works with the current chalkboard and print to PDF functionality (they work on totally different representations of the slide deck)

@paul-sheridan
Copy link
Author

Is there a suggested workflow for people, like me, who want to annotate their Quarto generated lecture slides and share the results?

@jjallaire
Copy link
Collaborator

Honestly, print them out, annotate them, then scan the annotated pages back into a PDF. Crude but effective until the PDF printing and chalkboard modules know how to play together.

@jjallaire jjallaire added this to the Future milestone Aug 14, 2022
@paul-sheridan
Copy link
Author

paul-sheridan commented Aug 14, 2022

I'm all for this "whatever works" kind of approach. But I'm missing something about how your suggestion would work for my use case. To be (more) specific, I want to

  • Annotate slides using the brush tool while I'm going over them in class.
  • Make the annotated version of the slides available to students thereafter.

Will your above suggestion work for this?

@jjallaire
Copy link
Collaborator

I can't imagine how my suggestion could work for that use case unless you were somehow training a camera on the printed slides as you go over them in class. I'm sorry this doesn't all work together -- we have integrated a 3rd party plugin (chalkboard) that doesn't happen to anticipate this use case. At this point I think we'd need to make direct changes to the plugin (or get them to make it work, looks like they don't intend to implement this but are open to a PR: rajgoel/reveal.js-plugins#97).

So you could go the camera route but that seems quite involved! It is possible to save your annotations in a JSON file and then subsequently reload them: https://quarto.org/docs/presentations/revealjs/presenting.html#restoring-drawings. If you did this along with listing the chalkboard.json file as a resource then you could publish your slides to gh-pages, Quarto Pub, or Netlify:

---
title: "chalkboard"
format: 
  revealjs:
    chalkboard:
      src: chalkboard.json
resources:
  - chalkboard.json
---

Then:

quarto publish quarto-pub slides.qmd
quarto publish netlify slides.qmd

See docs on publishing here: https://quarto.org/docs/publishing/

We should be automatically picking up the chalkboard.json as a resource but we aren't (I'll make a change to ensure that we are but in the meantime the resources technique shown above should work.

@jjallaire jjallaire self-assigned this Aug 14, 2022
@jjallaire jjallaire modified the milestones: Future, v1.1 Aug 14, 2022
@jjallaire
Copy link
Collaborator

Okay, we are now automatically including the chalkboard: src JSON file as a resource when publishing, so no need for for the resources key, the following will suffice:

---
title: "chalkboard"
format: 
  revealjs:
    chalkboard:
      src: chalkboard.json
---

Commit: d68bdbc

This will be available in tomorrow's version of our v1.1 pre-release: https://quarto.org/docs/download/prerelease.html

@paul-sheridan
Copy link
Author

paul-sheridan commented Aug 15, 2022

Awesome. After installing the v1.1.70 pre-release, I tried your above code (saved as slides.qmd) with a sample annotation (saved as chalkboard.json) in the same folder (as slides.qmd). But the annotations are not reloaded.

Am I missing something here?

@jjallaire
Copy link
Collaborator

It's working on my end (albeit the chalkboard takes a second or two to load on each slide, that's probably by design to emulate drawing). If you could send a link to Git repo or Gist that fully reproduces what you are seeing and I can debug it from there.

@jjallaire jjallaire reopened this Aug 15, 2022
@jjallaire
Copy link
Collaborator

One note: you do need to re-render the .qmd with the chalkboard: src entry in order for it to work.

@paul-sheridan
Copy link
Author

So I made a rudimentary GitHub repo with my slides.qmd, chalkboard.json, and supporting files.

Is this to what you're referring above by "a link to a Git repo"?

If not, can I ask you to elaborate a bit on what you require?

If so, then here is some extra information about the steps I'm taking that result in the annotations not re-rendering.

  1. Render slides.qmd.
  2. Open the generated slides.html file in Chrome.
  3. Make a test annotation to the title slide of slides.html and download the resulting chalkboard.json file to the same folder as slides.qmd.
  4. Re-render slides.qmd.
  5. Open the regenerated slides.html in Chrome.
  6. Observe there are no annotations to be seen.

@jjallaire
Copy link
Collaborator

Okay, I think I see the problem(s). There are two things that could be preventing you from seeing the annotations:

(1) The chalkboard.json file is loaded as a remote resources so opening slides.html in Chrome won't work. The slides need to be served from a web server (which they will be once you quarto publish them).

(2) Chalkboard annotations don't appear on the title slide until you navigate away from it and back (this is just a bug/vagary of the chalkboard plugin)

From your repo I did this:

git clone https://github.com/paul-sheridan/quarto-annotation-testing.git
cd quarto-annotation-testing
quarto preview slides.qmd

And saw this after navigating away from the title slide and back:

Screen Shot 2022-08-15 at 5 01 57 PM

@paul-sheridan
Copy link
Author

Terrific! Thanks a lot. I'm sorted now. I lost sight of the slides needing to be served from a web server...

@davi-moreira
Copy link

Are there any updates on directly downloading the PDF file with the annotations, or is this still the only option?

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

No branches or pull requests

3 participants