Skip to content

Instantly share code, notes, and snippets.

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

aspose-com-kb

View GitHub Profile
@aspose-com-kb
aspose-com-kb / Convert OBJ to GLB.java
Last active September 26, 2025 09:45
Convert OBJ to GLB in Java. For further details: https://kb.aspose.com/3d/java/convert-obj-to-glb-in-java/
// Create an instance of the Scene class
com.aspose.threed.Scene scene = new com.aspose.threed.Scene();
// Load the input OBJ file
scene.open("input.obj");
// Initialize save options
var glbSaveOptions = new com.aspose.threed.GltfSaveOptions(com.aspose.threed.FileContentType.BINARY);
// Save GLB file
// Create an instance of the Scene class
Aspose.ThreeD.Scene scene = new Aspose.ThreeD.Scene();
// Load the input OBJ file
scene.Open("input.obj");
// Initialize save options
var glbSaveOptions = new Aspose.ThreeD.Formats.GltfSaveOptions(Aspose.ThreeD.FileContentType.Binary);
// Save GLB file
import aspose.barcode as barcode
from aspose.barcode import *
from aspose.pydrawing import Color
# Apply license
license = barcode.License()
license.set_license("license.lic")
# Create a QR code generator
import com.aspose.barcode.License;
import com.aspose.barcode.generation.*;
public class SetBarcodeChecksum {
public static void main(String[] args) {
try {
// Load Aspose.BarCode license
License lic = new License();
lic.setLicense("License.lic");
using Aspose.BarCode;
using Aspose.BarCode.Generation;
// Load Aspose.BarCode license
License lic = new License();
lic.SetLicense("License.lic");
// Instantiate barcode object and set Code39FullASCII encoding
BarcodeGenerator generator = new BarcodeGenerator(
EncodeTypes.Code39FullASCII, "Electronics Item 12345");
import com.aspose.imaging.Image;
import com.aspose.imaging.License;
import com.aspose.imaging.fileformats.eps.EpsImage;
import com.aspose.imaging.imageoptions.PdfOptions;
public class DocxToJson {
public static void main(String[] args) {
try {
// Activate Aspose.Imaging license
License license = new License();
new Aspose.Words.License().SetLicense("license.lic");
new Aspose.Cells.License().SetLicense("license.lic");
// Load Word document
Aspose.Words.Document doc = new Aspose.Words.Document("input.docx");
// Save document in HTML format
doc.Save("html_output.html", Aspose.Words.SaveFormat.Html);
// Load the HTML file in an instance of Aspose.Cells.Workbook class
import com.aspose.font.*; // Aspose.Font classes
import java.io.FileOutputStream;
import java.io.IOException;
public class TtfToWoff {
public static void main(String[] args) {
try {
// Load Aspose.Font license
License lic = new License();
lic.setLicense("License.lic");
// Aspose.Font namespaces
using Aspose.Font;
using Aspose.Font.Sources;
// Load Aspose.Font license
License lic = new License();
lic.SetLicense("License.lic");
// Open ttf font
string fontPath = "Geneva.ttf";
import com.aspose.font.FileSystemStreamSource;
import com.aspose.font.Font;
import com.aspose.font.FontDefinition;
import com.aspose.font.FontFileDefinition;
import com.aspose.font.FontType;
import com.aspose.font.License;
import com.aspose.font.TtfFont;
import javax.imageio.ImageIO;