[R] dtp point and pdf

Roland Kaiser roland.kaiser at sbg.ac.at
Mon Nov 12 17:41:50 CET 2007


Hi all!

I encountered precision problems using pdf().

So far, I found out, that pdf() sets the Mediabox
to even values in dtp points (1/72 inch).

This can be seen in the following example.

page.width <- 13.1/2.54 # in centimeters
page.height <- 19/2.54

pdf(file = "foo.pdf", width = page.width, height = page.height)
plot(0,0)
dev.off()

# The size of the Mediabox in foo.pdf is
# /MediaBox [0 0 371 538]
# but ist should be

dtp.pt <- 1/72

page.width/dtp.pt
# [1] 371.3386
page.height/dtp.pt
# [1] 538.5827

Any ideas to cope with this problem.

Thanks

Roland



More information about the R-help mailing list