Aspose.Page PS Converter for .NET
Aspose.Page PS Converter for .NET enables developers to convert PostScript (PS) and Encapsulated PostScript (EPS) files into universally compatible PDF and image formats such as JPEG, PNG, TIFF, BMP, and GIF. The plugin simplifies PS parsing and rendering through a clean API, suitable for desktop, web, or cloud-based .NET applications.
Installation and Setup
To start using the PS Converter:
- Install the Aspose.Page for .NET NuGet package. See Installation .
- Configure metered licensing as described in Metered Licensing to unlock full functionality.
Aspose.Page.Metered metered = new Aspose.Page.Metered();
metered.SetMeteredKey("PublicKey", "PrivateKey");
Features and Functionalities
PS to PDF Conversion
- Convert
.ps
and.eps
files to high-quality PDF. - Preserves vector graphics, fonts, and searchable text.
- Supports modern PDF specifications (PDF 1.4–2.0, PDF/A compliance).
- Embeds or subsets fonts automatically to reduce file size.
PS to Image Conversion
- Render PS pages into image formats like JPEG, PNG, TIFF, BMP, GIF.
- Control DPI, resolution, color depth, and compression.
- Generate single-page or multi-page TIFFs.
- Preserve transparency where supported.
Color Management
- Output in RGB, CMYK, or grayscale color modes.
- Apply ICC profiles for precise color reproduction.
- Adjust brightness, contrast, or gamma during rendering.
Page Range and Layout Control
- Convert selected pages or page ranges.
- Rotate, scale, or fit pages to custom output dimensions.
- Add headers, footers, or watermarks using callback hooks.
Performance and Resource Management
- Stream-based APIs to handle large PS/EPS files efficiently.
- Parallel conversion support for batch processing.
- Built-in disposal of unmanaged resources for memory safety.
Integration and Extensibility
- Fluent API design integrates with dependency injection.
- Events for progress reporting and custom logging.
- Extendable rendering pipeline for custom filters.
Example: Convert PS to PDF
using Aspose.Page.EPS;
using Aspose.Page.EPS.Device;
// Load PostScript file
using (PsDocument document = new PsDocument("input.ps"))
{
PsConverter converter = new PsConverter(document);
PsConverterToPdfOptions options = new PsConverterToPdfOptions();
// Save output PDF
converter.Convert(options, "output.pdf");
}
Example: Convert PS to Image
using Aspose.Page.EPS;
using Aspose.Page.EPS.Device;
using (PsDocument document = new PsDocument("input.ps"))
{
PsConverter converter = new PsConverter(document);
PsConverterToImageOptions options = new PsConverterToImageOptions(ImageFormat.Png);
options.Resolution = 300;
converter.Convert(options, "output.png");
}
Tips and Best Practices
- Validate PS/EPS files for syntax before conversion.
- Match output DPI and color settings with the target medium (print vs. screen).
- Use multi-threading for batch conversions.
- Dispose converter instances to release unmanaged resources.
- Profile resource usage in long-running services and tune accordingly.
System Requirements
- OS: Windows, Linux, or macOS with .NET Framework or .NET Core
- Frameworks: .NET Standard 2.0+, .NET Core, .NET 5/6+, Xamarin, Mono
- IDE: Microsoft Visual Studio, JetBrains Rider, Visual Studio Code
Frequently Asked Questions
What formats can be converted?
PostScript (.ps
, .eps
) to PDF and image formats including JPEG, PNG, BMP, GIF, and TIFF.
Is font embedding supported? Yes, fonts can be embedded or subset during PDF generation.
Can I convert only specific pages? Yes, you can specify single pages or page ranges for conversion.
Is metered licensing supported? Yes, token-based metered licensing is supported for usage tracking.