views:

38

answers:

1

I have this code

guile> (cairo-pdf-surface-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>)

+1  A: 

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).

Chris Jester-Young
At the maintainer's request (I verified this answer with him on IRC), I've filed a bug for the documentation: https://bugs.freedesktop.org/show_bug.cgi?id=30510
Chris Jester-Young