gpt4 book ai didi

scheme - 如何在guile中创建开罗表面

转载 作者:行者123 更新时间:2023-12-04 06:45:20 25 4
gpt4 key购买 nike

我有这个代码

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

最佳答案

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

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

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

关于scheme - 如何在guile中创建开罗表面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3821347/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com