Overview
I am trying to generate a pdf doc from R markdown document (using ramnathv's slidify library, and the io2012 framework). This process is described briefly here.
The one-liner he provides works perfectly, except that I don't see images in my pdf doc.
However, in the example given above which links to jtleek's repository (available here), it appears that images are included in generated pdfs, successfully.
I am not sure if the problem lies with my javascript, or with the HTML code generated by slidify/R.
Replicating the Problem
The problem can be replicated as follows :
casperjs makepdf.js http://jburos.github.io/test-slidify-to-pdf/index.html index.pdf 1000
[ NOTE: In order for the example to work, you have to have installed casperjs & phantomjs. ]
Where the contents of makepdf.js are:
var casper = require('casper').create({viewportSize:{width:1500,height:1000}});
var args = casper.cli.args;
var imgfile = (args[1] || Math.random().toString(36).slice(2))
casper.start(args[0], function() {
this.wait(args[2], function(){
this.captureSelector(imgfile, "slides");
});
});
casper.run();
Alternatively, you can replicate the problem by cloning my git repository,
git clone [email protected]:jburos/test-slidify-to-pdf.git
cd test-slidify-to-pdf
casperjs makepdf.js index.pdf 1000
Again, the problem is that the index.pdf doc does not include any images, which are rendered by index.html.
Background
I would note that the full process has several steps:
- Use R/slidify/knitR to convert
- .Rmd file -> .md file
- .md file -> .html file
- Use casperjs to convert
- .html file -> .pdf file
Alternate methods of generating a pdf from Rmd I've considered include:
- using pandoc to generate beamer pdf:
pandoc index.md -t beamer -o index_beamer.pdf
- yields
! LaTeX Error: File ``ifluatex.sty' not found.
- yields
- using Chrome browser to print index.html to pdf
- yields left-truncated image file, as described in the above post
- using pandoc to generate pdf from md file:
- yields pdf (not slideshow style) also not containing images
Many thanks for your assistance.