gt
gt copied to clipboard
gtsave to pdf results in long whitespace
I found that while writing tables to pdf using gtsave, the resulting pdf has a long stretch of white space following the table (seems to be correlated with size of table--the longer the table, the longer the trailing whitespace).
I found that using webshot I was able to address this particular problem by flagging the webshot option cliprect = 'viewport' and setting zoom = 1 in file gt/export.R at line 204.
I didn't find this issue reported by anyone else, so maybe it's specific to me but I found it very reproducible.
Thank you!
I had the same issue, I could clip the white space by adding zoom = 1
in gtsave, e.g. gtsave("epj.pdf", zoom = 1)
@ldiao thank you so much for discovering the right setting. I will take a look at this again and set the proper default for PDF.
PDF export via webshot simply uses an 8.5 x 11'' page and the whitespace you're getting is simply the rest of the page. Because of this there's nothing really to fix here.
Even with zoom = 1, there white space on both the right and left side are way too long. Any other way to reduce the margin on right/left?
I agree that PDF export is really suboptimal. I'd like the cropbox to be set similarly to the PNG export. Unfortunately this is not really possible with just webshot
but seems more doable with the webshot2
and chromote
packages. I'll do some work to add support for webshot2
and I hope to get PDF export in a better place.