How to create cairo surface in guile
I have this code
guile> (cairo-pdf-surfac开发者_如何学运维e-create "foo.pdf" 100.0 100.0)
; and get this error
standard input:29:1: In procedure cairo-pdf-surface-create in expression (cairo-pdf-surface-create "foo.pdf" 100.0 ...):
standard input:29:1: Wrong type (expecting string): 100.0
ABORT: (wrong-type-arg)
and when I use strings as width and height
guile> (cairo-pdf-surface-create "foo.pdf" "100.0" "100.0")
Backtrace:
In standard input:
30: 0* [cairo-pdf-surface-create "foo.pdf" {"100.0"} "100.0"]
standard input:30:1: In procedure cairo-pdf-surface-create in expression (cairo-pdf-surface-create "foo.pdf" "100.0" ...):
standard input:30:1: Wrong type (expecting real number): "100.0"
Documentation says:
cairo-pdf-surface-create (filename <char>) [Function]
(width-in-points <double>) (height-in-points <double>) ⇒ (ret <cairo-surface-t>)
At least for the most recent version, try this:
(cairo-pdf-surface-create 100.0 100.0 "foo.pdf")
See the source, which specifies the arguments in the order (sx sy filename)
, with the filename being optional (using the current output port if not specified).
精彩评论