Skip to content

build_pdf tends to crop bottom of slide? #16

Open

Description

@mattansb

This seems to happen for images that are too close to the bottom of the slide.
E.g.:

https://mattansb.github.io/bayesian-evidence-iscop-2021/#33

Turns into this:

image

Activity

  1. jhelvy commented on Feb 24, 2021

    @jhelvy
    Owner

    Hmm, I've tried two ways to build a pdf from your slides, but both ways cut off the bottom charts:

    input <- "https://mattansb.github.io/bayesian-evidence-iscop-2021/index.html"
    build_pdf(input)
    build_pdf(input, complex_slides = TRUE)

    The first approach relies on pagedown::chrome_print(). The second uses the {chromote} package, but in the end also prints from Chrome. So I think this may just be an issue with how Chrome prints pages to pdfs.

    Edit: The above code will only work with v. 0.0.5, which I just pushed. I realized I hadn't enabled some of the build functions to build directly from slides on a website, but that now should be enabled.

  2. mattansb commented on Feb 25, 2021

    @mattansb
    Author

    So I think this may just be an issue with how Chrome prints pages to pdfs.

    I'm not sure about that - attached is a print from chrome which does have the last graph: test.pdf

  3. jhelvy commented on Feb 25, 2021

    @jhelvy
    Owner

    How did you print that? I just opened the slides in Chrome on my machine and printed them directly from Chrome, and I got the same crop problem. If you're able to print it without the crop there must be a solution, maybe a setting that can be tweaked.

  4. mattansb commented on Feb 25, 2021

    @mattansb
    Author

    I did the same - opened the slide in chrome (win10) and ctrl+p as pdf...

  5. jhelvy commented on Feb 25, 2021

    @jhelvy
    Owner

    Interesting...I'm on a mac, but I wouldn't expect that to be the root cause. It's particularly odd that you get a difference between using "Open Chrome -> ctrl + p" compared to pagedown::chrome_print() since those should be the same thing. I feel like there might be a different print setting in the "Open Chrome -> ctrl + p" method that is not used with pagedown::chrome_print()

  6. mattansb commented on Feb 25, 2021

    @mattansb
    Author

    This is what I get:

    image

  7. jhelvy commented on Feb 25, 2021

    @jhelvy
    Owner

    Okay so it looks like it might be an issue with the margin settings.

    On my machine, the default margins crop the slide:

    margin_default

    But if I set the margins to "minimum" and include headers and footers, it doesn't crop the charts, though is still looks like it crops a tiny amount on the bottom since the slide number is chopped a bit:

    margin_minimum

    I still can't find a setting on my end that looks like yours, but this is promising as I can probably change the print settings from pagedown::chrome_print().

  8. mattansb commented on Feb 25, 2021

    @mattansb
    Author

    Awesome (:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions