Created
July 4, 2024 05:08
-
-
Save aspose-com-gists/fd34ec121f0d3c57891aa4acd623c7d4 to your computer and use it in GitHub Desktop.
Aspose.Page for Python gists for Landing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Initialize PsDocument with the input PostScript file | |
document = PsDocument(data_dir + "inputForImage.ps") | |
#Initialize options object with necessary parameters. | |
options = ImageSaveOptions(aspose.page.drawing.imaging.ImageFormat.PNG) | |
# Save PS document as array of image bytes, one bytes array for one page. | |
images_bytes = document.save_as_image(options) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Initialize PsDocument with the input PostScript 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) | |
# Save document as PDF | |
document.save_as_pdf(data_dir + "outputPDF_out.pdf", options) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Load XPS document form the file | |
document = XpsDocument(data_dir + "input.xps", XpsLoadOptions()) | |
# Initialize options object with necessary parameters. | |
options = JpegSaveOptions() | |
# Save XPS document to the images byte arrays. The first dimension is for inner documents | |
# and the second one is for pages within inner documents. | |
imagesBytes = document.save_as_image(options) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment