Why does my reveal.js PDF output have 45 000 pages instead of 350 pages after upgrading from 2.6.2 to 3.5.0?

Viewed 319

I recently upgraded this slidedeck from reveal.js 2.6.2 to 3.5.0. Everything works fine, except that the PDF export now has 45 000 pages instead of 350 pages like before the upgrade.

To reproduce, click on this link and ask for the print dialog in Chrome, which will already show the number of pages.

My index.html hasn't changed. It has still this code:

<script>
    if (window.location.search.match(/print-pdf/gi)) {
        document.write('<link rel="stylesheet" href="website/reveal/css/print/pdf.css">');
    }
</script>

Which is still equivalent to the PDF export instructions in the latest readme.

2 Answers

According to the PDF export instructions,

Slides that are too tall to fit within a single page will expand onto multiple pages.

When I opened your presentation in browser based on Chromium, I saw quite a lot of empty space between slides. I think the problem may be somewhere here.

As of reveal.js 3, there is a regression that cannot handle overlapping images with position: absolute well in PDF export.

Related