您好,我用aspose cad 24.4进行DWG转图片时,一开始出现文字重叠,经过技术人员指导后,改为这个代码,但是我运行完之后文字变成了问号,我发现如果不使用STEDI.shx字体,就产生和之前一样文字重叠的效果,一旦使用STEDI.shx字体,大部分文本都变成问号了。
import aspose.cad as cad
from aspose.cad.imageoptions import PngOptions
from aspose.pycore import cast
image = cad.Image.load("example.dwg")
cad_image = cast(cad.fileformats.cad.CadImage, image)
for style in cad_image.styles:
print(style.primary_font_name, style.big_font_name)
cadRasterizationOptions = cad.imageoptions.CadRasterizationOptions()
cadRasterizationOptions.shx_fonts =[
"fonts\HZTXT.SHX",
"fonts\STEDI.shx",
"fonts\SIMPLEX.shx",
"fonts\COMPLEX.shx",
"fonts\\tssdeng.shx",
"fonts\\romanc.shx"
]
options = PngOptions()
options.vector_rasterization_options = cadRasterizationOptions
image.save("result.png", options)`
这是全部文件relatedFiles.zip (3.7 MB)