使用 PS 格式文件 | Aspose.Page 提供 .NET

PSEPS 扩展分别与 Adob​​e 开发的 PostScript 和 Encapsulated PostScript 语言相关联。

PS 是一种动态页面描述语言。它使用图形运算符、过程、控制运算符和变量。 EPS 是一种受限制的 PostScript 语言。某些 PostScript 运算符被禁止用于 EPS 文件。同时,EPS 文件必须符合 PostScript 文档结构约定规范,该规范要求使用结构注释。通常,EPS 格式用于描述可封装在 PostScript 文件及其派生文件中的单页图形。

Aspose.Page 库允许创建包含适当图形元素的 PS 或 EPS 文件,但在本指南中,我们将仅使用 PS 文件类型。 因此,我们使用以下代码创建 PS 文件:

1using (Stream outPsStream = new FileStream(dir + "document.ps", FileMode.Create))
2{
3    //Create save options
4    PsSaveOptions options = new PsSaveOptions();
5    
6    // Create new multipaged PS Document
7    PsDocument document = new PsDocument(outPsStream, options, true);
8}

如果有人希望创建 EPS 文件,他们应该使用以下代码:

 1using (Stream outPsStream = new FileStream(dir + "document.eps", FileMode.Create))
 2{
 3    //Create save options
 4    PsSaveOptions options = new PsSaveOptions();
 5    //Set format of saved document as EPS
 6    options.SaveFormat = PsSaveFormat.EPS;
 7    
 8    // Create new EPS Document
 9    PsDocument document = new PsDocument(outPsStream, options, false);
10}

请参阅在 Java 中处理 PS 文档。

Aspose.Page 库只能创建静态 PS/EPS 文档。不支持控制运算符。

目前,Aspose.Page 库只能创建 PostScript 文档,而不能编辑。

本章包含有关使用 .NET 版 Aspose.Page API 解决方案处理 PS 文件的信息。您将在后续文章中找到该功能工作原理的代码示例。

Have any questions about Aspose.Page?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.