astefanutti / decktape

PDF exporter for HTML presentations
MIT License
2.21k stars 177 forks source link

White border in remark.js slides #122

Closed Nicolabo closed 7 years ago

Nicolabo commented 7 years ago

Hi I converted my remark html slides into pdf. It works fine although I observed, that when I use ratio: 16:9 it's included a white border for each slide (look at dark-colored slide).

      var slideshow = remark.create({
          ratio: '16:9',
          highlightStyle: 'monokai',
          highlightLanguage: 'remark',
          highlightLines: true
        }) ;

I write

npm bin`/decktape --screenshots-size=1600x900 ...

Does anybody know whether this is decktape issue or remark.js issue?

Thanks,

astefanutti commented 7 years ago

Remark sizing is a bit tricky so it's better not specifying the size option (nor the screenshots-sizeoption) and the DeckTape plugin automatically figures the size out of the presentation ratio. Without them, you won't get the white border.

Nicolabo commented 7 years ago

I just tested without --screenshots argument and I still see white border. Are you sure it should work fine with ratio: 16:9?

astefanutti commented 7 years ago

It's used by Backslide (https://github.com/sinedied/backslide/) that's Remark based and which defaults to 16:9 and here is the result: test.pdf.

Do use you DeckTape latest version and what's the exact command you use?

Nicolabo commented 7 years ago

I use 2.0.0 version.

I downloaded your test.pdf file and when I turn on the full screen I still see white border at the bottom and on the right.

When it comes to exact command I installed dectape locally so then

`npm bin`/decktape file:///Users/../test.html test.pdf
astefanutti commented 7 years ago

OK, if that's the thin white border we're talking about, I've had to add some extra margins otherwise Chrome PDF export via Puppeteer messes up the layout for some reasons: https://github.com/astefanutti/decktape/blob/65f29cd11b255e2cfb84447fc9ec11ca0e29ea04/plugins/remark.js#L37-L38 I may find a way to adjust the PDF size as a post-processing step.

Nicolabo commented 7 years ago

Would be great!

astefanutti commented 7 years ago

Should be fixed in version 2.6.0. Let me know if that doesn't work for you.

Nicolabo commented 7 years ago

Yes, I updated decktape and still, the problem occurs.

astefanutti commented 7 years ago

Could you share your presentation sample, or at least the PDF output?

Nicolabo commented 7 years ago

I just included ratio: 16:9 in remark introduction slide deck. remark.html.zip

Nicolabo commented 7 years ago

And my pdf output. remark_new.pdf.zip

astefanutti commented 7 years ago

While I removed some of the margins, it seems there is still that thin margin at the bottom for 16:9 presentations. It seems it is present as well when using the Chrome print. I suspect this has to do with the Remark scaler. I'm afraid there isn't much that can be done at DeckTape's level without any major contorsions.