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

Add support for a PDF export with speaker notes #5

Open
hasalex opened this issue Nov 25, 2016 · 7 comments
Open

Add support for a PDF export with speaker notes #5

hasalex opened this issue Nov 25, 2016 · 7 comments

Comments

@hasalex
Copy link
Contributor

hasalex commented Nov 25, 2016

I need a PDF export of my slides, in the same way than OOo Note's view. A4 pages,the first part of each page contains the slide itself and the second part contains the speaker notes.

I have a stylesheet that work with Chrome's "Export as PDF" feature, but I don't know how to switch to the stylesheet. Maybe a module, like the overview, that switches to a "slides with notes" view.

Any idea ?

@hasalex
Copy link
Contributor Author

hasalex commented Nov 28, 2016

I switch to an other option, based on gulp. It's probably simpler, and it fits my personal need.

With the regular gulp commands, It uses the print.styl file, and when I add -n to the gulp command, it uses the print-notes.styl.

I've put the feature in my fork at https://github.com/hasalex/presentation-bespoke-starter/tree/export-pdf-notes.

Tell me if you're interested with a PR.

@hasalex hasalex closed this as completed Nov 28, 2016
@mraible
Copy link

mraible commented Nov 28, 2016

@hasalex Good idea! I tried implementing this in my project and get the following error:

[14:12:11] Plumber found unhandled error:
 Error in plugin 'gulp-stylus'
Message:
    /Users/mraible/dev/presentations/microservices-for-the-masses/presentation/src/styles/print-notes.styl:4:41
   1| $real-margin-mm = 20mm
   2| 
   3| $ratio = 3.7795       // I don't know why this value, but it works
   4| $slide-height-mm = unit($slide-height / $ratio, 'mm')
----------------------------------------------^
   5| $slide-width-mm = unit($slide-width / $ratio, 'mm')
   6| 
   7| $zoom = unit( (210mm - 2 * $real-margin-mm) / $slide-width-mm, '')

cannot perform $slide-height / (3.7795)

Details:
    lineno: 4
    column: 41
    filename: /Users/mraible/dev/presentations/microservices-for-the-masses/presentation/src/styles/print-notes.styl
    stylusStack: 

I created a variables.styl and required it at the top of main.styl. Its contents are as follows:

rem-calc(value)
  ((u = unit(value)) is "px") ? unit(round(value/16, 4), "rem") : value

$slide-width = 640px
$slide-height = 360px

@hasalex
Copy link
Contributor Author

hasalex commented Nov 28, 2016

@mraible A small checklist:

  • create variables.styl and print-notes.styl
  • add @require './variables' in main.styl
  • remove @require './print' in main.styl
  • add the dev dependency to gulp-concat in package.json
  • add concat = require('gulp-concat') in gulpfile.js
  • update the css task in gulpfile.js

With all that stuff, it seems to be working. Yet there's some layout to arrange...
I'll prepare a PR.

@hasalex
Copy link
Contributor Author

hasalex commented Nov 28, 2016

@mraible BTW it should fix your problem with the regular export to PDF, as the gulp task add the print.styl or print-notes.styl file at the end of the stylesheet.

@mraible
Copy link

mraible commented Nov 28, 2016

@hasalex That worked - thanks!

@mojavelinux mojavelinux reopened this Nov 28, 2016
@mojavelinux
Copy link
Member

This is looking really good. I'll do some review and see if we can get this integrated into this project.

Btw, if you use gulp-concat, don't forget to add it to package.json.

@hasalex
Copy link
Contributor Author

hasalex commented Nov 29, 2016

Thanks for pointing me the package.json, @mojavelinux. I've updated the check list.

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