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
using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
// Load the avif file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.avif")))
@aspose-com-gists
aspose-com-gists / Scatter-Graph-Creator.java
Created July 16, 2024 18:41
Develop a Scatter Graph Creator in Java
package com.example;
import com.aspose.slides.*;
import java.io.File;
public class main
{
public static void main(String[] args)
{
// The path to the documents directory.
String dataDir = "/Desktop/";
// Create directory if it is not already present.
@aspose-com-gists
aspose-com-gists / Convert-HTML-to-XPS.java
Created July 10, 2024 08:56
Convert HTML to XPS in Java
package com.example;
import com.aspose.html.HTMLDocument;
import com.aspose.html.saving.XpsSaveOptions;
import com.aspose.html.converters.Converter;
// Convert HTML to XPS in Java
public class main
{
public static void main(String[] args) throws java.io.IOException
{
String dataDir = "/Desktop/";
@aspose-com-gists
aspose-com-gists / LaTeX-to-XPS.cs
Created July 8, 2024 08:47
C# Library for LaTeX to XPS
using Aspose.TeX.IO;
using Aspose.TeX;
using Aspose.TeX.Presentation.Xps;
// Define the working directory.
string dataDir = "C:\\files\\";
// Open a FileStream on the output path
using (Stream xpsStream = File.Open(Path.Combine(dataDir, "any-name.xps"), FileMode.Create))
{
// Create conversion options for Object LaTeX format upon Object TeX engine by calling the ConsoleAppOptions method.
@aspose-com-gists
aspose-com-gists / GetCustomProperties.cs
Created July 6, 2024 13:41
Manage MAPI Properties using C#
// Retrieve and print custom properties
var customProperties = msg.GetCustomProperties();
foreach (var customProperty in customProperties)
{
Console.WriteLine($"Tag: {customProperty.Tag}");
Console.WriteLine($"Canonical Name: {customProperty.Descriptor.CanonicalName}");
Console.WriteLine($"Data Type: {customProperty.Descriptor.DataType}");
}
@aspose-com-gists
aspose-com-gists / XPS-to-Image.py
Created July 6, 2024 11:52
Convert XPS to BMP in Python
import aspose
from aspose.page.xps import *
from aspose.page.xps.presentation.image import *
import os
# The path to the documents directory.
data_dir = "C:\\Desktop\\"
# Input file
input_file_name = data_dir + "input.xps"
#Outut file
@aspose-com-gists
aspose-com-gists / convert-postscript-to-images.py
Created July 4, 2024 05:08
Aspose.Page for Python gists for Landing
# 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)