Skip to main content

PS and XPS File Manipulation via Python API

banner

Product Page | Docs | Demos | API Reference | Examples | Blog | Search | Free Support | Temporary License

Aspose.Page for Python via .NET is an on premise Python API that allows you to add PS/EPS and XPS manipulation features to your own applications. The API also supports converting XPS, EPS & PS documents to other formats.

Developers can perform various operations on PS and XPS documents, such as, add text, images, pages, gradient, grid using the visual brush, transparency object and set opacity mask. It allows you to create, edit and convert the file pages as well as the ability to manipulate documents and elements, create vector graphics, group shapes, and specifying colors in different color spaces including sRGB, scRGB, and any space-based on ICC profile.

XPS, EPS & PS Processing Features

  • Create & modify XPS documents via API.
  • Create PS & EPS documents via API.
  • Add pages to PS & XPS documents.
  • Create vector graphic shapes (Path element) and text strings (Glyphs element).
  • Group various elements as well as modify the appearance of text strings and graphics.
  • Support for visual brush, image brush, solid color brush, and more.
  • Work with multiple documents within an XPS document.
  • Preserve print tickets and add default print tickets to new XPS documents.
  • Perform cross-package operations such as inserting a page from another document.
  • Conversion of XPS, PS & EPS documents to other popular formats.
  • Supports PostScript language levels 1-3 with an exception of font types: Type2 (CFF), Type14 (Chameleon), Types 9, 10, 11.

Supported Read Formats

XPS, EPS, PS

Save XPS Documents As

Fixed Layout: PDF
Image: BMP, TIFF, JPEG, PNG

Save PS & EPS Documents As

Metafiles: EMF, WMF
Animation: GIF
Image: BMP, TIFF, JPEG, PNG

Platform Independence

Aspose.Page for Python via .NET can be used to develop 32-bit and 64-bit Python applications for Windows where Python 3.5 or later is installed.

Get Started

Are you ready to give Aspose.Page for Python a try? Simply execute pip install aspose-page to install wheel package package. If you already have Aspose.Page for Python and want to upgrade the version, please execute pip install --upgrade aspose-page to get the latest version.

Create an XPS Document from Scratch via Python Code

Execute the below code snippet to see how Aspose.Page API performs in your own environment or check the GitHub Repository for other common usage scenarios.

# The path to the documents directory.
dir = Util.get_data_dir_working_with_document()
# Create new XPS Document
x_docs = XpsDocument()

# add glyph to the document
glyphs = x_docs.add_glyphs("Arial", 12, aspose.pydrawing.FontStyle.REGULAR, 300, 450, "Hello World!")

glyphs.fill = x_docs.create_solid_color_brush(aspose.pydrawing.Color.black)

# save result
x_docs.save(dir + "output.xps")

Convert a PostScript (PS) File to PDF Format

Aspose.Page for Python allows you to work with document conversion, such as; PS to images, PS to PDF, XPS to images, XPS to PDF and so on. The following snippet demonstrates the conversion of PS to PDF using streams:

# The path to the documents directory.
data_dir = Util.get_data_dir_working_with_document_conversion()

# Initialize PsDocument instance from PostScript input file
document = PsDocument(data_dir + "input.ps")

# If you want to convert Postscript file despite of minor errors set this flag
suppress_errors = True

#Initialize options object with necessary parameters.
options = PdfSaveOptions(suppress_errors)
# Default page size is 595x842 and it is not mandatory to set it in PdfSaveOptions
# But if you need to specify the page size use following line
options = PdfSaveOptions(new Size(595, 842), suppress_errors)
# If you want to add special folder where fonts are stored. Default fonts folder in OS is always included.
options.additional_fonts_folders = [ """{FONT_FOLDER}""" ]
# Save PS document as PDF file
document.save_as_pdf(data_dir + "outputPDF_out.pdf", options)

Product Page | Docs | Demos | API Reference | Examples | Blog | Search | Free Support | Temporary License

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

aspose_page-26.8.0-py3-none-win_amd64.whl (51.3 MB view details)

Uploaded Python 3Windows x86-64

aspose_page-26.8.0-py3-none-win32.whl (45.2 MB view details)

Uploaded Python 3Windows x86

File details

Details for the file aspose_page-26.8.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: aspose_page-26.8.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 51.3 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.0

File hashes

Hashes for aspose_page-26.8.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 877092e15e09e197888b8b645eec94e070a61b7ea236cb938bb0666edbecd4e6
MD5 5a9d9083a989013d01cf8593cd63d1af
BLAKE2b-256 f2b81e1f7fd37dd74152354b8df9435811ca0d4da6fa800ffb5d1ec7129d2895

See more details on using hashes here.

File details

Details for the file aspose_page-26.8.0-py3-none-win32.whl.

File metadata

  • Download URL: aspose_page-26.8.0-py3-none-win32.whl
  • Upload date:
  • Size: 45.2 MB
  • Tags: Python 3, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.0

File hashes

Hashes for aspose_page-26.8.0-py3-none-win32.whl
Algorithm Hash digest
SHA256 0083bacfd6c6c79cc990e970c5aae08caa5588a3f907ac24fb224f2c6a2ff43a
MD5 7903b4d40a47548650daf129a0eef8d1
BLAKE2b-256 3efc3ea5a25d61e40fce216a9ab7633fcea9e6dd54100b0fc5c4836c785d7b70

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

26.8.0 This release

2 files

26.6.0

2 files

26.4.0

2 files

26.2.0

2 files

25.12.0

2 files

25.8.0

2 files

25.6.0

2 files

25.4.0

2 files

25.2.0

2 files

24.12.0

2 files

24.9.0

2 files

24.7.0

2 files

24.6.0

2 files

24.2.0

2 files

24.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page