hakimel / reveal.js

The HTML Presentation Framework
https://revealjs.com
MIT License
67.28k stars 16.62k forks source link

print-pdf: svg images are not displayed in preview and not printed to PDF #3428

Open yarikoptic opened 1 year ago

yarikoptic commented 1 year ago

try e.g. http://datasets.datalad.org/centerforopenneuroscience/talks/2023-brain-dandi-imgdatasrc.html?print-pdf#/ - first page has .svg, 2nd has .png for the same img.

yarikoptic commented 1 year ago

and even some pngs do not work -- I added 3rd page demonstrating it to the same URL. overall relevant html is

<section  data-transition="slide">
  <section >
    <h2>svg -- not in print to PDF</h2>
    <img data-src="pics/20210421-INCF-dandischema.svg"/>
  </section>

  <section >
    <h2>png -- there!</h2>
    <img src="pics/20210421-INCF-dandischema.png"/>
  </section>

   <section>
    <h2>and even some PNGs?</h2>
    <img data-src="pics/dandiarchive-webshots.png"/>
   </section>

</section>
neclepsio commented 7 months ago

I have the same problem with jpgs, so I don't think it's related to format.

neclepsio commented 7 months ago

It seems a problem with Chrome; using Edge my images show.

Also, with Chrome, setting smaller height and margin for the element makes it work (see https://superuser.com/a/930915/293794).

In particular, I solved my problem adding this to my index.html:

<style>
    html.print-pdf .reveal img {
        max-height: 80% !important;
    }
</style>