Skip to content

Instantly share code, notes, and snippets.

@conholdate-gists
conholdate-gists / Delete-PDF-Page.cs
Created May 13, 2024 10:30
Add or Delete Pages in PDF using C# | Insert Remove Pages in PDF
// Load the input PDF document
Document document = new Document("Sample.pdf");
// Delete the Page Number Two - The 2nd Page
document.Pages.Delete(1);
// Save output PDF file
document.Save("Page_Deleted.pdf");
@conholdate-gists
conholdate-gists / Excel-to-CSV.java
Created May 6, 2024 07:12
Convert Excel XLS XLSX to CSV in Java
// Load the input Excel file
com.aspose.cells.Workbook workbook = new com.aspose.cells.Workbook("Excel.xlsx");
// Convert XLSX to CSV file
workbook.save("ExcelToCSV.csv", com.aspose.cells.SaveFormat.CSV);
@conholdate-gists
conholdate-gists / Excel-to-CSV.cs
Created May 6, 2024 07:11
Convert Excel XLS XLSX to CSV in C# .NET
// Load the input Excel file
Workbook workbook = new Workbook("Excel.xlsx");
// Convert XLSX to CSV file
workbook.Save("ExcelToCSV.csv", Aspose.Cells.SaveFormat.Csv);
@conholdate-gists
conholdate-gists / convert-stl-to-obj.cs
Created April 27, 2024 01:56
Convert STL to OBJ in C# .NET or Java
// Initialize an object of Scene class
Aspose.ThreeD.Scene scene = new Aspose.ThreeD.Scene();
// Load input STL file with Open method
scene.Open("test.stl");
// Specify the output format for the Wavefront OBJ file
Aspose.ThreeD.FileFormat outputformat = Aspose.ThreeD.FileFormat.WavefrontOBJ;
// Convert STL to OBJ Object file
@conholdate-gists
conholdate-gists / Convert-PDF-to-PPT.java
Last active April 26, 2024 10:59
Convert PDF to PPT using Java | Convert PDF to PPTX using Java
// Create an object of Document class and load the source file
Document doc = new Document("Sample.pdf");
// Invoke this method setBackground to set the background color of the document
doc.setBackground(java.awt.Color.CYAN);
// Call this setFitWindow method to set flag specifying whether document window must be resized to fit the first displayed page.
doc.setFitWindow(true);
// Instantiate PptxSaveOptions instance
@conholdate-gists
conholdate-gists / compress-word-documents.cs
Created April 16, 2024 21:27
Compress Word Documents in C# | DOC DOCX Compressor
// Load input Word document
Aspose.Words.Document doc = new Aspose.Words.Document("input.docx");
// Create an object of OoxmlSaveOptions class
Aspose.Words.Saving.OoxmlSaveOptions saveOptions = new Aspose.Words.Saving.OoxmlSaveOptions(Aspose.Words.SaveFormat.Docx);
// Use Super Fast compression level for faster and weaker compression
saveOptions.CompressionLevel = Aspose.Words.Saving.CompressionLevel.SuperFast;
// Save compressed Word DOCX document
@conholdate-gists
conholdate-gists / convert-fbx-to-obj.cs
Created April 15, 2024 20:53
Convert FBX to OBJ Online for Free | FBX to OBJ in C# or Java
string inputFile ="file.fbx";
using (Image image = Image.Load(inputFile))
{
// Initialize ObjOptions class object
ObjOptions options = new ObjOptions();
// Export FBX to OBJ
string outPath = "output.obj";
image.Save(outPath, options);
}
@conholdate-gists
conholdate-gists / ExportDataToExcel_Java.md
Last active April 3, 2024 19:23
Export Data to Excel in Java

Learn how to export data from Arrays, JSON, or CSV to Excel programmatically using Java:

You can export data to Excel programmatically as described below:

  1. Export Array to Excel in Java
  2. Generate Excel File in Java
  3. Export ArrayList to Excel in Java
  4. Collection of Custom Objects to Excel in Java
  5. Export Data with Merged Cells in Java
  6. Copy Rows and Columns from one Excel file to Another in Java
  7. Export JSON Data to Excel in Java
@conholdate-gists
conholdate-gists / convert-pdf-to-mobi-xml.java
Created March 27, 2024 00:50
Convert PDF to XML in Java | PDF to XML Converter
// Load PDF document
Document document = new Document("input.pdf");
// Convert PDF to XML format
document.save("output.xml", com.aspose.pdf.SaveFormat.MobiXml);
@conholdate-gists
conholdate-gists / convert-excel-to-json-advanced.cs
Created March 22, 2024 09:59
Convert Excel XLSX XLS to JSON in C# .NET
// Load Excel file
Workbook wb = new Workbook("Workbook.xlsx");
// Create JsonSaveOptions class object
Aspose.Cells.JsonSaveOptions options = new Aspose.Cells.JsonSaveOptions();
options.SkipEmptyRows = true;
options.ExportAsString = true;
// Save as JSON
wb.Save("Excel_to_JSON.json", options);