Skip to content

Instantly share code, notes, and snippets.

View aspose-com-gists's full-sized avatar

Aspose.com Gists aspose-com-gists

View GitHub Profile
@aspose-com-gists
aspose-com-gists / readme.md
Created July 27, 2022 09:12
Convert SVG to PNG in Python
@aspose-com-gists
aspose-com-gists / readme.md
Last active May 4, 2024 08:32
Split a Word Document into Multiple Documents in Python
@aspose-com-gists
aspose-com-gists / DWGtoSVG.cs
Last active May 2, 2024 18:01
Convert DWG to SVG in C# .NET
// Load the input DWG file
Image image = Image.Load("sample.dwg");
// Initialize SvgOptions class object
ImageOptions.SvgOptions options = new ImageOptions.SvgOptions();
// Set SVG color mode
options.ColorType = SvgColorMode.Grayscale;
options.TextAsShapes = true;
@aspose-com-gists
aspose-com-gists / Convert-PostScript-to-GIF.java
Last active May 2, 2024 08:25
High Code Java API to Convert PostScript to GIF
package com.example;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import com.aspose.eps.PsDocument;
import com.aspose.eps.device.ImageDevice;
import com.aspose.eps.device.ImageSaveOptions;
public class Main {
// High Code Java API to Convert PostScript to GIF
@aspose-com-gists
aspose-com-gists / XPS-to-PDF.py
Created May 1, 2024 18:40
Convert XPS to PDF in Python - XPS to PDF
from aspose.page.xps import *
from aspose.page.xps.presentation.pdf import *
data_dir = "./working-files"
# Initialize streams for input and output files.
with open(data_dir + "XPStoPDF_out.pdf", "wb") as pdf_stream:
with open(data_dir + "input.xps", "rb") as xps_stream:
# Load the XPS document from the stream by creating an object of the XpsDocument class.
document = XpsDocument(xps_stream, XpsLoadOptions())
# Create an instance of the PdfSaveOptions class.
@aspose-com-gists
aspose-com-gists / Convert-PostScript-to-PDF.py
Created April 30, 2024 19:04
Convert PostScript to PDF in Python
from aspose.page.eps import *
from aspose.page.eps.device import *
# Define the working directory.
dir = "./files"
# Initialize streams for input and output files.
pdf_stream = open(dir + "outputPDF_out.pdf", "wb")
ps_stream = open(dir + "input.ps", "rb",)
# Instantiate an instance of the PsDocument class and load the source PS file.
document = PsDocument(ps_stream)
@aspose-com-gists
aspose-com-gists / Convert-PPT-to-GIF.js
Last active April 30, 2024 06:48
Convert PPT to GIF using a Node.js Slides API
var aspose = aspose || {};
// Import aspose.slides.via.java into your working project.
aspose.slides = require("aspose.slides.via.java");
// Create an object of the Presentation class and load the source PPT/PPTX file.
var pres = new aspose.slides.Presentation("/first.pptx");
try
{
// Convert PPT to GIF and save the file by calling the save method.
pres.save("/PPT-to-gif.gif",aspose.slides.SaveFormat.Gif);
console.log("PPT to animated GIF conversion done successfully.")
@aspose-com-gists
aspose-com-gists / SVG-to-PNG-Conversion.cs
Created April 29, 2024 11:02
SVG to PNG Conversion in C#
using Aspose.Html.Rendering;
using Aspose.Html.Rendering.Image;
namespace Aspose.Html
{
public class SVGtoPNG
{
static void Main(string[] args)
{
// Create an instance of the SVGDocument class to load the source SVG file.