-
Notifications
You must be signed in to change notification settings - Fork 858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export to PDF #50
Comments
Currently there aren't, but it's definitely on the list of features that would be nice to have, via printing, like reveal.js does. |
Does this mean reveal.js doesn't work to print to PDF on Mac OSX? I too am receiving only the first page. |
@Version2beta I think you should discuss that in the revelant reveal.js issues. |
+1 And is there any workaround for the time being? |
The current version of remark now supports exporting the current, single slide to PDF via Chrome's print functionality. It's kind of useless as of right now, but export of all slides is on it's way. |
The last release 0.5.6 of remark now supports exporting to PDF via Chrome's print preview and Save to PDF option. |
If I set the ratio to 4:3, and start to write and tune the slide content: |
Printing has primarily been tested for a display ratio of 4:3. If this is of importance to you, please create a new issue regarding 16:9 support :) |
Greate job! 👍 |
Regression: export to PDF doesn't work in Chrome 39.0. Despite of using ratio of 4:3 slides do not fit to PDF page. Try on remarkjs.com site. |
Regression confirmed on Chromium 38.0.2125.111 Built on Ubuntu 14.04, running on LinuxMint 17 (290379) (64-bit) |
@danielstankiewicz @kynan I "fixed" this by setting device resolution to 1024x768 in Chrome DevTools. |
@laudenberg thanks for 1024x768 tip. without it the layout was coming out with wide left margin. |
+1 for the 1024x768 tip! |
thanks for the tip! |
On my wide screen, I had to set 1024x576. |
Just to confirm:
BTW, shouldn;t the PDF export instruction be incorporated in Wiki? |
Had to switch to 1024x594 now on my Chome 40.0.2214.115 m (Win7), but still works indeed (as i have some dark pages from time to time, i still had a black tiny border on the next page with 1024x576). |
Another problem discovered recently: it doesn't support text shadows /
blurs etc.
|
wkhtmltopdf works very well (http://wkhtmltopdf.org/) sudo aptitude install wkhtmltopdf
wkhtmltopdf --page-width 111 --page-height 148 -O "Landscape" gnab.github.io/remark remark.pdf or without margin wkhtmltopdf --page-width 111 --page-height 148 -B 0 -L 0 -R 0 -T 0 -O "Landscape" gnab.github.io/remark remark.pdf |
@jeci-sarl It works, but for me it generates pdf with just one page insatead of 40, e.g. https://dl.dropboxusercontent.com/u/379506/out2.pdf The command I used to generate it
Edit
It might it has something to do with my local setup. |
@leonardinius maybe it's due to version of wkhtmltopdf or QT, I'm on Debian 8 (QT 4.8.6). $ wkhtmltopdf --version
wkhtmltopdf 0.12.1 |
I try to export pdf slides using chrome. I set device resolution to 1024x594 but now I have three slides on single pdf page. What settings should I adjust so slides will fit the page? |
I don't recall the end result/solution (in the end it all worked fine Hopefully it helps. |
wkhtmltopdf doesn't work for me too: remark.pdf contain only grey box
|
@cbrown1 worked best for me |
@gnab Thanks for the nice framework! It happens quite often for me to send the final presentation around. How about creating a wiki section about PDF export and mentioning the window size trick there? |
I found that trying to print worked correctly if I first hit 'C' to clone the presentation into a separate window and print from there. Otherwise, it would only print the first slide. |
Why not merge @mpusz fix into main source?
|
|
@laudenberg I started a discussion on Decktape about this. I think you're going to need a NodeJS script to do the actual save of the |
For me, I currently use the following settings: <!DOCTYPE html>
<html>
<head>
<title>IntelliJ IDEA</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="../remark.css">
</head>
<body>
<textarea id="source">
<!-- My ow content -->
</textarea>
<script type="text/javascript" src="../remark-latest-min.js"></script>
<script type="text/javascript">
var slideshow = remark.create({
ratio: '4:3'
});
</script>
</body>
</html> And then in Chrome (this only works in Chrome), from the Developer Tools menu, toggle the Device Toolbar (the second icon from the left) to use its Responsive Web Design simulation capability: Define an 800x600 device, print from it, and then you will get an almost perfect PDF output. |
I have a presentation with some dark background so I wanted to cut it correctly to the pixel. The solution was:
|
Trying to make a general fix for @mpusz solution above. Which javascript variable contains the actual (final) dimensions of the presentation. |
Following @mpusz's suggestion above, I prepared a short JS function to set the page size dynamically, so that you don't need to worry about the aspect ratio: (function() {
var d = document, s = d.createElement("style"), r = d.querySelector(".remark-slide-scaler");
if (!r) return;
s.type = "text/css";
s.innerHTML = "@page { size: " + r.style.width + " " + r.style.height +"; }";
d.head.appendChild(s);
})(); |
Chrome just started supporting headless mode. I created a Node.js script that uses the headless interface and writes out the PDF. I've tested it with Chrome 60 and it works well. |
If you want a squared presentation, you should change the page to this:
|
astefanutti/decktape worked like a charm for me:
Kudos to @astefanutti 🙇 |
When I add an effect to css .remark-slide-container {
transition: opacity 1s linear, right 1s ease-in-out;
opacity: 0;
right: 1000px;
}
.remark-visible {
transition: opacity 1s linear, right 1s ease-in-out;
opacity: 1;
right: 0px;
}
.remark-fading {
z-index: 9;
}
.remark-visible ~ .remark-slide-container {
right: -1000px;
} Then only the current page shows me on the print, all the others are empty - white. I actually need to print the initial setup (because these effects make me a problem in print), does anyone know how to solve this problem? Well yes, and to mention, the Tnx |
@MilovanTomasevic I think you need to reset opacity for print media (i.e. define CSS separately for |
Yes, also removing the CSS animation for |
@lexsys27 I have the same problem (
gives a single page grey box. As of today (2020), what is the solution to make |
FYI, I've been working on a package that builds xaringan slides to multiple output types: html, pdf, pptx, gif, and a couple options for a png of the first slide: |
It did work smoothly for me, too, but take into account the CORS problems and rather go through a locally hosted presentation (astefanutti/decktape#207) |
It works perfectly! |
@enricolacchin that worked like a charm, thanks! |
Apply styling hack described here: gnab/remark#50 (comment) Hopefully makes the printing more painless.
Is there a "nice" way to export a Remark presentation as a PDF? By nice I mean 1) rendered like the screen output as closely as possible and 2) in vector format i.e. slides not rendered as raster images and concatenated.
It seems reveal.js has a PDF export via a print stylesheet, which unfortunately doesn't work on Linux.
The text was updated successfully, but these errors were encountered: