2

I'm using reveal js to display some locally hosted plotly charts using iframe.

This works fine other than ability to export to pdf. When I go to http://localhost:138/presentations/pres1/?print-pdf (as described here), I am able to export the text, but the plotly charts don't appear. I assume this is due to the plotly library not loading.

Is there a way of loading the local html file so that it can be exported to pdf?

I'm using the following in my slides:

#### Slide with iframe

<iframe data-src="http://localhost:138/html/localpage.html" width="900" height="500" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:0px solid #666; margin-bottom:5px; max-width: 600%;" allowfullscreen=true></iframe>

I'm saving the plotly chart using export interactive html

1 Answer 1

1

Maybe too late for you, but I'll still answer for future searchers of the same problem :-)

This is due to the lazy-loading of iframes. When you set the data-preload attribute to the iframe it should appear in the print version.

I described my problem here, maybe we'll be able to add an automated solution as well: https://github.com/hakimel/reveal.js/issues/2795#issue-714101762

Sign up to request clarification or add additional context in comments.

2 Comments

Could you elaborate slightly on how to set the data-preload attribute? Thanks!
@SaaruLindestøkke like this: <iframe data-src="https://hakim.se" data-preload></iframe>as described in revealjs.com/media/#lazy-loading-iframes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.