Description Usage Arguments Value Author(s) See Also Examples
Cropping of PDF files using the pdfcrop
comand line tool by Heiko
Oberdiek.
1 2 |
fileName |
character string denoting the path/ name of the input PDF file |
outFileName |
character string denoting the name of the output PDF file.
If not specified, "_cr.pdf" is appended to |
margins |
numeric vector defining how many points of all four white margins are cropped away (left, top, right, bottom) in addition to the automatic cropping. Negative values mean that white space is added instead of cropped away. If NULL, the default, the underlying pdfcrop tool tries to automatically crop all margins. |
Returns nothing, but as a side effect saves the cropped .pdf file.
Christoph Schmidt <schmidtchristoph@users.noreply.github.com>
knitr plot_crop
,
pdfcrop https://www.ctan.org/pkg/pdfcrop?lang=en
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | library(networkD3)
data(MisLinks)
data(MisNodes)
p <- forceNetwork(Links = MisLinks, Nodes = MisNodes,
Source = "source", Target = "target",
Value = "value", NodeID = "name",
Group = "group", opacity = 0.9,
height = 900, width = 900)
# generated pdf needs a serious cropping
jsGraphic2Pdf(p, c(900, 900, 20, 20), slow = TRUE)
# in this case, automatic results (no margins given) are not good enough
pdfcrop("JSgraphic.pdf", "JSgraphicCr.pdf")
# manually setting margin produces a better result
pdfcrop("JSgraphic.pdf", "JSgraphicCr2.pdf", margins = c(2, 1, 93, 2))
file.remove(c("JSgraphic.pdf", "JSgraphicCr.pdf", "JSgraphicCr2.pdf"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.