Skip to content

Instantly share code, notes, and snippets.

@aspose-com-kb
Last active June 28, 2024 15:33
Show Gist options
  • Save aspose-com-kb/70a9ef3055a6b3c32627914cdfc602d1 to your computer and use it in GitHub Desktop.
Save aspose-com-kb/70a9ef3055a6b3c32627914cdfc602d1 to your computer and use it in GitHub Desktop.
Resize EPS in Python.
from aspose.page import *
from aspose.page.eps import *
from aspose.page.eps.device import *
from aspose.page.eps.xmp import *
import aspose.pydrawing
#Create an input stream for EPS file
with open("input.eps", "rb",) as input_eps_stream:
#Initialize PsDocument object with input stream
doc = PsDocument(input_eps_stream)
#Get size of EPS image
old_size = doc.extract_eps_size()
#Create an output stream for resized EPS
with open("output_resize_points.eps", "wb") as output_eps_stream:
#Increase EPS size in 2 times and save to the output stream
doc.resize_eps(output_eps_stream, aspose.pydrawing.SizeF(old_size.width * 2, old_size.height * 2), aspose.page.Units.POINTS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment