2

我有这个代码

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)

当我使用字符串作为宽度和高度时

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"

文档说:

cairo-pdf-surface-create (filename <char>) [Function]
         (width-in-points <double>) (height-in-points <double>)
         ⇒ (ret <cairo-surface-t>)

4

1 回答 1

3

至少对于最新版本,试试这个:

(cairo-pdf-surface-create 100.0 100.0 "foo.pdf")

查看source,它指定 order 中的参数,(sx sy filename)文件名是可选的(如果未指定,则使用当前输出端口)。

于 2010-09-30T18:17:11.363 回答