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

'pdf.css' setting to enable slide numbers does not work #1072

Closed
KurtPfeifle opened this issue Dec 9, 2014 · 3 comments
Closed

'pdf.css' setting to enable slide numbers does not work #1072

KurtPfeifle opened this issue Dec 9, 2014 · 3 comments

Comments

@KurtPfeifle
Copy link

My 'js/reveal.js' has the following setting:

       // Display the page number of the current slide
       //slideNumber: false,
       slideNumber: true,

So slide numbers _DO_ appear in the slide deck. Here is a screenshot montage showing this (skipping the title slide). The slide numbers are rather small, but they do show up:

revealjs-slides-html

My 'css/print/pdf.css' file has the following setting:

/* SECTION 2: Remove any elements not needed in print.
   This would include navigation, ads, sidebars, etc. */
.nestedarrow,
.reveal .controls,
.reveal .progress,
//.reveal .slide-number,
.reveal .playback,
.reveal .overview,
.fork-reveal,
.share-reveal,
.state-background {
   display: none !important;
}

I commented out the line which marks the .slide-number as an element that shouldn't be printed.

However, when creating a PDF (using Chrome 39.0.2171.71 (64-bit) on Mac OSX Mavericks 10.9.5), a slide number does only appear for the first slide, not for the following slides. Here is a screenshot montage of the PDF pages (skipping the second slide):

pdfstylesheet-kungfooforreveal js co---outcome

The title slide shows navigation controls as well as slide number '0' (very small though, but it is there...). The other slides do show neither navigation controls, nor slide numbers.

I've tried various other methods:

  1. Remove the commented out line //.reveal.js .slide-number, altogether from the 'pdf.css'
  2. Remove the complete SECTION 2 from the 'pdf.css'
  3. Replace the display: none !important; statement by a display: initial !important; statement.
  4. Replace the display: none !important; statement by a display: inline !important; statement.

Neither did make a difference.


My reveal.js is pulled directly from the current GitHub sources (AFAICS it is the very current one); my remote branch when pulling seems to be origin/dev.


Update

I tried the same with Firefox (v. 34.0.5) now instead of Chrome, also using a '....html?print-pdf#/' URL. Firefox's PDF does look a tad bit different to Chrome's: here we get identical navigation controls plus the slide number '0' on _ALL_ slides but the title slide (which _should_ be numbered '0', according to the real HTML slide deck).

firefox-pdfstylesheet-kungfooforreveal js co---outcome

@mosabua
Copy link

mosabua commented Dec 10, 2014

I believe that the correct behaviour the header (being repeated on print in each slide) is implemented in a fork available at .. https://github.com/Ciges/reveal.js also see #806

I think this behaviour should be the default for reveal itself and it should be expanded to work for the footer as well as add support for the slidenumber being rendered correctly.

@hakimel
Copy link
Owner

hakimel commented Oct 29, 2015

I just added support for slide numbers PDF exports. Just make sure the reveal.js "slideNumber" config value is set to true and the numbers will automatically be generated for each slide when exporting to PDF.

@hakimel hakimel closed this as completed Oct 29, 2015
@mosabua
Copy link

mosabua commented Oct 29, 2015

Thats awesome @hakimel .. thanks

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