Working with PS format files | .NET

PS and EPS extensions are linked to the PostScript and Encapsulated PostScript languages respectively that Adobe developed.

PS is a dynamic Page description language. It uses graphics operators, procedures, control operators and variables. EPS is a restricted PostScript. Some PostScript operators are prohibited from using EPS files. At the same time, the EPS file must conform to PostScript Document Structuring Conventions Specifications that suppose to use structural comments. Generally, EPS was intended for the description of 1-paged graphics that can be encapsulated in PostScript files and their derivations.

Aspose.Page library allows the creation of both PS or EPS files with proper graphics elements, but in this guide, we will use only the PS file type. So we use for the creation of PS file such code:

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}

If someone wish to create EPS file they should use the following code:

 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}

See working with PS documents in Java and C++.

Aspose.Page library can create only static PS/EPS documents. Control operators are not supported.

At this moment Aspose.Page library can only create PostScript documents, not edit it.

This chapter includes information about working with PS files using Aspose.Page API solution for .NET. There you will find the next articles with the code examples of how the functionality works.

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.