gpt4 book ai didi

c# - 在 PostScript 中添加表格

转载 作者:行者123 更新时间:2023-12-02 22:33:01 26 4
gpt4 key购买 nike

我有一个 c# 应用程序,我想在 postscript 文件中插入一条消息,所以我创建了一个类似的表单

%%BeginResource: form myfrm
/myfrm
<<
/FormType 1
/BBox [ 0 0 771 618] def
/Matrix [1 0 0 1 0 0] def
/PaintProc{pop
..........
}
>> /Form defineresource pop
%%EndResource

当我在页面中插入页面时像这样

newpath
gsave
3800 5025 translate
3221.875 2575 scale
myfrm execform
grestore
closepath

当我在 ghostview 中查看时出现错误。任何我做错的建议,以前我做的是从文本创建一个图像并以 EPS 形式插入它工作得很好但是 ps 文件大小增加了。如果可能的话我可以在后记中插入一个文本框。

编辑后:-

/myfrm 
<<
/FormType 1
/BBox [ 0 0 771 618]
/Matrix [1 0 0 1 0 0]
/PaintProc{pop
0 0 moveto
(my name is ali) show
}
>> def

.....
.....
.....
newpath
gsave
3800 5025 translate
3221.875 2575 scale
myfrm execform
grestore
closepath

但是没有文字显示

最佳答案

您已经定义了一个 Form 资源的实例,但是在调用 execform 之前您还没有加载该资源。您要么需要:

1) 只定义表单字典(但不将其存储为资源)

/myfrm <<
/FormType 1
...
>> def
...
myfrm execform

2) 在执行之前加载资源

/myfrm /Form findresource execform

关于c# - 在 PostScript 中添加表格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11898100/

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