Skip to content

Instantly share code, notes, and snippets.

@aspose-com-kb
Last active September 23, 2023 05:01
How to Convert OBJ to PDF in Java. For more details: https://kb.aspose.com/3d/java/how-to-convert-obj-to-pdf-in-java/
import com.aspose.threed.*;
public class Main
{
public static void main(String[] args) throws Exception // Change OBJ to PDF in Java
{
com.aspose.threed.TrialException.setSuppressTrialException(true);
// Set the licenses
// new License().setLicense("License.lic");
// Load the input OBJ file
Scene scene = Scene.fromFile("Aspose3D.obj");
// Create PdfSaveOptions class object
PdfSaveOptions options = new PdfSaveOptions();
// Convert OBJ to PDF format
scene.save("output.pdf", options);
System.out.println("Done");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment