Hi, we really want to add watermark into a JT file. What we need is: a Java program can take JT file as input, add watermark, then write out to a new JT file. Could anyone have sample code to fulfil this task?
Thanks,
Sean Lu
Hi, we really want to add watermark into a JT file. What we need is: a Java program can take JT file as input, add watermark, then write out to a new JT file. Could anyone have sample code to fulfil this task?
Thanks,
Sean Lu
Add a watermark to a JT file with Aspose.3D for Java in three steps:
Watermark object, configure the text and appearance.import com.aspose.threed.*;
import com.aspose.threed.watermark.*;
public class JtWatermark {
public static void main(String[] args) throws Exception {
// 1. Load the source JT file
Scene scene = new Scene("input.jt");
// 2. Build the watermark
Watermark watermark = new Watermark();
// Text to display
String text = "CONFIDENTIAL";
// Options – adjust as needed
WatermarkOptions opts = new WatermarkOptions();
opts.setFontSize(48);
opts.setColor(java.awt.Color.RED);
opts.setOpacity(0.3f); // 0‑1 (transparent to opaque)
opts.setRotationAngle(45); // degrees
opts.setHorizontalAlignment(HorizontalAlignment.Center);
opts.setVerticalAlignment(VerticalAlignment.Center);
// Add the text watermark
watermark.addTextWatermark(text, opts);
// 3. Apply the watermark to the scene and save
scene.addWatermark(watermark);
scene.save("output.jt", SaveOptions.createSaveOptions(SaveFormat.JT));
}
}
What you need
| Item | Details |
|---|---|
| Aspose.3D for Java | Latest version (e.g., 23.12 or newer). |
| License | A valid Aspose.3D license file (otherwise the output will contain a trial watermark). |
| JDK | Java 8 or higher. |
Next steps
WatermarkOptions to match the visual style you need.Thanks for quick reply. I tried your code segment, and have couple of unresolved methods/variables. (please see snapshot below)
image.png (140.1 KB)
Note: I download the latest version of aspose-3d Java package: aspose-3d-25.11.0.jar and aspose-3d-25.11.0-jdk8.jar
Thanks,
Sean Lu
Hi @seanxwlu
Thank you for reaching out to us. At this time, our product does not support exporting files in the JT format, so this functionality is not available. We understand how important this feature can be, and we’ll keep your request in mind as we plan future enhancements.
If there’s anything else we can assist you with or if you have alternative format requirements, please let us know—we’re happy to help.
Regards,
Lex Chou