dataanalysis icon indicating copy to clipboard operation
dataanalysis copied to clipboard

How convert the presentation of slidify in a pdf file?

Open bluepill5 opened this issue 12 years ago • 15 comments

Hi, i'm start working wih slidify, my question is: How did you convert the .Rmd file in a .pdf file?

Thanks.

bluepill5 avatar Aug 29 '13 21:08 bluepill5

Once you get a .md file you can use Pandoc http://johnmacfarlane.net/pandoc/ to get a pdf file. Also check the slidify documentation or browse the past issues https://github.com/ramnathv/slidify/issues?state=closed (someone might have asked that previously).

lcolladotor avatar Aug 29 '13 21:08 lcolladotor

Thanks, i'm gonna check.

bluepill5 avatar Aug 29 '13 21:08 bluepill5

For the slides in this repo, you can directly use Google Chrome's print feature to save it as a PDF.

ramnathv avatar Aug 29 '13 22:08 ramnathv

Perfect, thank you so much for the help.

bluepill5 avatar Aug 29 '13 23:08 bluepill5

Anyone know of a way to print with one slide per page? Currently Chrome ignores slide boundaries and prints as much as it can fit.

khughitt avatar Apr 21 '14 16:04 khughitt

The same problem here. Chrome is ignoring slides boundaries, and sometimes doesn't print slide titles, etc.

Nowosad avatar May 10 '14 20:05 Nowosad

There were some changes to Google Chrome, which broke the print styles for the slide framework being used here. I would recommend printing to PDF from Safari of Firefox. I tried it today and it seems to work well for me.

ramnathv avatar May 10 '14 20:05 ramnathv

:+1: Firefox worked for me as well.

khughitt avatar May 11 '14 02:05 khughitt

Printing using pandoc certainly works well, specially since the yaml is nicely transformed into a title. But what I was trying to do was to get a pdf that would keep all the custom styling created through CSS. My ultimate goal is to have the presentation imported into slideshare.

I tried to use http://wkhtmltopdf.org/ , which works pretty well in converting local and online html-css into very nice looking pdf or images, but that didn't work for slidify (pdf or images). I then tried standalone and selfcontained, but still no results.

I wonder whether anybody might have been successful in uploading a slidify presentation in any format to slideshare.

thanks

rpietro avatar Jul 27 '14 05:07 rpietro

The best way to do this is to use the browsers print function. Firefox seems to give the best results retaining most of the styling. There is also an automated solution that uses casperjs to capture each slide as screenshot and convert them into a pdf.

ramnathv avatar Jul 27 '14 05:07 ramnathv

I'm getting no-where with Firefox/Chrome/Safari/Opera print functions. They print only the current slide and without any of the styles. I'm using html5slides, in case that matters. I'll try pandoc, but I thought I should let you know.

ptoche avatar Jan 19 '15 19:01 ptoche

Unfortunately, im also not winning with any of those major browsers, even if i use the io2012 framework.

juaneschutte avatar Feb 03 '15 13:02 juaneschutte

@juaneschutte , I've had more success with the io2012 framework and chrome (not tested with others).

There appear to be 2 problems: 1) the first, title page is messed up (only part of the title shows, not centered properly); 2) there is an empty white slide at the end (it's not numbered, so the problem is quite minor).

Here is my workflow:

  1. File --> Print
  2. Select 'Landscape' mode.
  3. Print using system dialog
  4. Select orientation (I forget which, but it makes a difference)
  5. Pages per sheet: 1 (other numbers resulted in slides being cut off)
  6. select the PDF button at the bottom left corner. This seems to be rather important.

The resulting PDF is available here for 28 days: http://www.fileconvoy.com/dfl.php?id=gbf535f69bcbe21aa999618530ff3fd43ada27bb5c

ptoche avatar Feb 04 '15 03:02 ptoche

Currently Firefox does a good job (it prints an extra blank page at the end, but otherwise fine), as long as you set the advanced printing options to landscape and remove headers, footers, and background colors. Chrome currently messes things up (in my case, it makes a mess of the title page and omits the second page, weird but true).

ptoche avatar Mar 01 '16 08:03 ptoche

On Mac OSX, this can be done using Rscript -e "Sys.setenv(RSTUDIO_PANDOC='/Applications/RStudio.app/Contents/MacOS/pandoc');library(rmarkdown); library(utils); render('input.Rmd', 'pdf_document')"`

NP-compete avatar Feb 25 '18 16:02 NP-compete