Skip to content

Instantly share code, notes, and snippets.

@conholdate-gists
conholdate-gists / convert-txt-to-excel-xlsx.cs
Created June 28, 2024 22:21
Convert TXT to Excel Worksheet XLSX XLS in C# .NET
// Create TxtLoadOptions class object
Aspose.Cells.TxtLoadOptions options = new Aspose.Cells.TxtLoadOptions();
// Load the TXT file
Workbook wb = new Workbook("input.txt", options);
// Save as XLSX
wb.Save("Excel.xlsx", Aspose.Cells.SaveFormat.Xlsx);
@conholdate-gists
conholdate-gists / convert-kml-to-shp.cs
Created June 27, 2024 11:38
Convert KML to SHP Shape File in C# .NET
// Specify conversion settings.
Aspose.Gis.ConversionOptions options = null;
// This options assigns Wgs84 to the destination layer.
if (Aspose.Gis.Drivers.Shapefile.SupportsSpatialReferenceSystem(Aspose.Gis.SpatialReferencing.SpatialReferenceSystem.Wgs84))
{
options = new Aspose.Gis.ConversionOptions()
{
DestinationSpatialReferenceSystem = Aspose.Gis.SpatialReferencing.SpatialReferenceSystem.Wgs84,
};
@conholdate-gists
conholdate-gists / Word-DOCX-to-Latex.cs
Created June 25, 2024 22:56
Convert Word DOCX Document to Latex in C# .NET
// Initialize a MemoryStream class object
MemoryStream stream = new MemoryStream();
// Load the input Word document
Aspose.Words.Document document = new Aspose.Words.Document("input.docx");
// Write the intermediate file to a stream
document.Save(stream , Aspose.Words.SaveFormat.Pdf);
// Load the intermediate PDF file
@conholdate-gists
conholdate-gists / convert-ost-to-pst.java
Created June 24, 2024 06:58
Convert OST to PST in Java
// Load the input OST file
com.aspose.email.PersonalStorage ost = com.aspose.email.PersonalStorage.fromFile(dataDir + "SampleOstFile.ost");
// Save the PST file
ost.saveAs("output.pst", com.aspose.email.FileFormat.Pst);
@conholdate-gists
conholdate-gists / convert-fbx-to-stl.java
Created June 13, 2024 08:23
Convert FBX to STL in Java
// Load the input FBX file
com.aspose.threed.Scene document = new com.aspose.threed.Scene("test.fbx");
// Initiate StlSaveOptions class object
com.aspose.threed.StlSaveOptions options = new com.aspose.threed.StlSaveOptions();
// Convert FBX to STL file
document.save("test.stl", options);
@conholdate-gists
conholdate-gists / create-organizational-chart.java
Last active June 12, 2024 14:11
Create Organizational Chart in Java
// Load masters from any existing diagram, stencil or template
String visioStencil = "Basic Shapes.vss";
String rectangleMaster = "Rectangle";
String connectorMaster = "Dynamic connector";
int pageNumber = 0;
double width = 1;
double height = 1;
double pinX = 4.25;
double pinY = 9.5;
// Define values to construct the hierarchy
@conholdate-gists
conholdate-gists / Create-Flowchart.cs
Created June 10, 2024 18:46
Create Flowchart Diagram in C# | Flowchart Generator
namespace CreateFlowchart
{
class Program
{
static void Main(string[] args)
{
//schema for the diagram to be created
Input diagramObject = new Input()
{
InputRectangles = new List<InputRectangle>() {
@conholdate-gists
conholdate-gists / text-to-json.cs
Created June 5, 2024 21:20
Convert TXT to JSON | TEXT to JSON Converter
// Load the input TXT file
Workbook workbook = new Workbook("input.txt");
// Convert TXT to JSON
workbook.Save("XML.xml", Aspose.Cells.SaveFormat.Xml);
@conholdate-gists
conholdate-gists / convert-html-to-jpg-image.java
Created June 4, 2024 10:29
Convert HTML to Image in Java | HTML to JPG PNG BMP TIFF Photo Converter
// Initialize an HTML document from the file
var document = new com.aspose.html.HTMLDocument("spring.html");
// Initialize ImageSaveOptions
var options = new com.aspose.html.saving.ImageSaveOptions(com.aspose.html.rendering.image.ImageFormat.Jpeg);
// Convert HTML to JPG
com.aspose.html.converters.Converter.convertHTML(document, options, "spring-output.jpg");
@conholdate-gists
conholdate-gists / convert-ost-to-pst.cs
Last active June 3, 2024 20:24
Convert OST to PST in C# | Email Conversion
// Load the source OST file from the disk
using (Aspose.Email.Storage.Pst.PersonalStorage personalOSTStorage = Aspose.Email.Storage.Pst.PersonalStorage.FromFile("Sample.ost"))
{
// Conver OST to PST
personalOSTStorage.SaveAs("ConvertedOst.pst", Aspose.Email.Storage.Pst.FileFormat.Pst);
}