SVG to TIFF Conversion with the Java API
Aspose.HTML for Java
converts SVG files and content to TIFF with
Converter.convertSVG()
. Load the vector source into SVGDocument, select ImageFormat.Tiff, and specify the destination path. The renderer processes SVG geometry, text, styles, and referenced resources before creating the TIFF image.
Generate TIFF Output from SVG
The example loads document.svg, selects TIFF output, and writes output.tiff. Try-with-resources guarantees that the SVG document is released.
Convert SVG to TIFF in Java
import com.aspose.html.converters.Converter;
import com.aspose.html.dom.svg.SVGDocument;
import com.aspose.html.rendering.image.ImageFormat;
import com.aspose.html.saving.ImageSaveOptions;
// Load the SVG document
try (SVGDocument document = new SVGDocument("document.svg")) {
// Select TIFF output
ImageSaveOptions options = new ImageSaveOptions(ImageFormat.Tiff);
// Convert SVG to TIFF
Converter.convertSVG(document, options, "output.tiff");
}
Check SVG to TIFF Conversion Online
Upload an SVG file or provide its URL to inspect the TIFF result before implementing the conversion in a Java workflow.
SVG to TIFF API Steps
- Add Aspose.HTML for Java to the project.
- Open the source with
SVGDocument. - Create
ImageSaveOptionswithImageFormat.Tiff. - Pass the document, options, and output path to
Converter.convertSVG().
Choose TIFF Compression and Resolution
ImageSaveOptions provides settings for page size, margins, resolution, background color, smoothing, CSS processing, text rendering, and TIFF compression. LZW is the default TIFF compression. Select settings according to file-size, fidelity, and compatibility requirements.
See
Convert SVG to JPG in Java
for the shared image workflow and the
ImageSaveOptions API Reference
.
Install Aspose.HTML for Java
Add Aspose.HTML for Java from the official Aspose repository. Replace ASPOSE_HTML_VERSION with an exact version from the
Aspose.HTML for Java releases
page, then reload or rebuild the project so the dependency is resolved.
Add the repository and dependency to the Maven project:
Maven – pom.xml
<repositories>
<repository>
<id>AsposeJavaAPI</id>
<url>https://releases.aspose.com/java/repo/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-html</artifactId>
<version>ASPOSE_HTML_VERSION</version>
</dependency>
</dependencies>Add the repository and dependency to the Gradle project:
Gradle – build.gradle
repositories {
maven {
url = uri('https://releases.aspose.com/java/repo/')
}
}
dependencies {
implementation 'com.aspose:aspose-html:ASPOSE_HTML_VERSION'
}Use a JDK compatible with the selected release. For manual JAR installation, Kotlin DSL, updates, and dependency troubleshooting, see Install Aspose.HTML for Java .
SVG to TIFF Conversion FAQ
1. Can I choose TIFF compression when converting SVG?
Yes. Configure TIFF compression in ImageSaveOptions before conversion. The default TIFF compression used by the options is LZW.
2. When is TIFF useful for SVG rasterization?
TIFF is useful in document imaging, publishing, scanning, and archival pipelines that require TIFF-compatible output and configurable compression.
3. Can I increase the resolution of a TIFF created from SVG?
Yes. Set horizontal and vertical resolution through ImageSaveOptions. Higher resolution increases pixel dimensions and usually increases file size.
4. Can I convert SVG to TIFF online for free?
Yes. Use the free online SVG to TIFF converter for a manual conversion. Use Aspose.HTML for Java for automated processing.
Related Java Conversions
Choose another SVG output or a related HTML rendering workflow.