Giter VIP home page Giter VIP logo

Comments (7)

astefanutti avatar astefanutti commented on May 29, 2024

It may be related to ariya/phantomjs#14194. Is the CSS file path relative?

from decktape.

gdrolet avatar gdrolet commented on May 29, 2024

In the HTML, there's this block:

    <script>
      var link = document.createElement( 'link' );
      link.rel = 'stylesheet';
      link.type = 'text/css';
      link.href = window.location.search.match( /print-pdf/gi ) ? 'conf1_files\reveal.js-3.2.0/css/print/pdf.css' : 'conf1_files\reveal.js-3.2.0/css/print/paper.css';
      document.getElementsByTagName( 'head' )[0].appendChild( link );
    </script>

I replaced (relative) paths to pdf.css with absolute paths (also replacing all backslashes with one forward slash):

<script>
      var link = document.createElement( 'link' );
      link.rel = 'stylesheet';
      link.type = 'text/css';
      link.href = window.location.search.match( /print-pdf/gi ) ? /E:/Code/conf1_files/reveal.js-3.2.0/css/print/pdf.css' : 'E:/Code/conf1_files/reveal.js-3.2.0/css/print/pdf.css';
      document.getElementsByTagName( 'head' )[0].appendChild( link );
    </script>

I don't get any error message when I run decktape but the result is not pretty... The same slide is repeated on all the slides and is an overlap of a few slides, not centered (i.e. text is cut as if text was out of the slide).

Do you have any suggestions on what I should do next or if you think this is a bug?

PhantomJS version: 2.0.0 (installed from Win 64 binaries)
Windows 7 Enterprise

Thanks

from decktape.

astefanutti avatar astefanutti commented on May 29, 2024

The original issue is likely related to ariya/phantomjs#14194.

When you test with the absolute path, could you try adding the file:// prefix?

As you're using Reveal.js, one option is to run grunt serve so that it's served on http://localhost:8000 and export it by using HTTP.

from decktape.

gdrolet avatar gdrolet commented on May 29, 2024

Ok thanks. And how would I export it using HTTP? With the Chrome PDF exporter plugin?

I tried creating the HTML (from markdown) with the self_contained = FALSE (I was using self_contained = TRUE). In the resulting HTML I get much more paths to reveal.js files but even after making the path modifications it doesn't work. In fact I get many more error messages (one for each of the paths its trying to access). Since when I use self_contained = TRUE I get only one error message (the one related to the <script> block mentioned previously, if I could find a way to "embed" what's in the "PDF export" <script> block as well would probably solve my problem but how to do it...

I will try it on my Linux machine at home see if I have more luck with using decktape.

from decktape.

gdrolet avatar gdrolet commented on May 29, 2024

Ok I got it to work by after I saw one of the pandoc options that was generated in R, when it converts a markdown document into HTML. I noticed this option --variable "revealjs-url=conf_1_files\reveal.js-3.2.0", that I replaced with an absolute path. I couldn't add file:/// without an error in the call to pandoc (maybe due to this bug: jgm/pandoc#1558. I will try updating my verson of pandoc, which is pretty old). I added file:///E:/Code/... manually in the resulting HTML and decktape ran without error. And the PDF looks good!

from decktape.

astefanutti avatar astefanutti commented on May 29, 2024

Great!

I'll update DeckTape once ariya/phantomjs#14194 is fixed so that we can test your use case.

from decktape.

astefanutti avatar astefanutti commented on May 29, 2024

Should be fixed in version 2.0.1 that uses headless Chrome. Let me know if you still face this issue.

from decktape.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.