GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - aspose-html/Aspose.HTML-for-Java: Aspose.HTML for Java examples

BranchesTags
Open more actions menu

Latest commit

 

History

41 Commits
41 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
Aspose.HTML-for-Java.Example
Aspose.HTML-for-Java.Example
 
 
Aspose.HTML-for-Java.Microbenchmark
Aspose.HTML-for-Java.Microbenchmark
 
 
Aspose.HTML-for-Java.Start
Aspose.HTML-for-Java.Start
 
 
Aspose.HTML-for-Java.WebService-on-Docker
Aspose.HTML-for-Java.WebService-on-Docker
 
 
docs
docs
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

Product Page | Docs | Release Notes | Download | Demos | API Reference | Blog | Free Support | Temporary License

Aspose.HTML for Java – Examples, Starter Projects, Benchmarks

This repository contains code examples, starter templates, and microbenchmarks demonstrating how to use Aspose.HTML for Java – a powerful library for working with HTML, MHTML, EPUB, Markdown, SVG, and various output formats in Java applications.

Aspose.HTML for Java enables developers to load, parse, generate, modify, and convert HTML documents in any Java environment, including desktop, server-side, microservices, and cloud applications.

This repository works hand in hand with the official Aspose.HTML for Java documentation. The examples provided here are intended to complement the documentation, extend it, and provide ready-to-use code snippets for processing, parsing, converting, and rendering HTML-based documents, working with the DOM, and more.

Key Features Demonstrated in This Repository

  • Create or load HTML documents from multiple sources.
  • Fully manipulate the HTML DOM: create, edit, remove, and replace nodes.
  • Extract data from HTML, including text and CSS styles for specific elements.
  • Navigate documents using Element Traversal, XPath, CSS selectors, and DOM traversal.
  • Execute and interact with JavaScript inside HTML documents.
  • Configure sandbox settings to control document processing and script behavior.
  • Convert HTML, XHTML, SVG, MHTML, Markdown, and EPUB to PDF, XPS, DOCX, and various image formats (PNG, JPEG, BMP, TIFF, GIF).
  • Fine-tune conversions with page size, resolution, custom stylesheets, resource handling, and script execution settings.
  • Convert between HTML and Markdown for migration or content-editing workflows.
  • Control rendering timeouts to optimize performance and resource usage.
  • Download website content and process online HTML resources.

Each example in the repository serves as a practical, ready-to-run usage scenario. More information about a wide range of document processing, conversion, and DOM manipulation functionality can be found here.

Repository Structure

  • Aspose.HTML-for-Java.Start – Basic startup examples for new users.
  • Aspose.HTML-for-Java.Example – Full collection of practical examples (HTML conversion, parsing, DOM operations, CSS handling, etc.).
  • Aspose.HTML-for-Java.Microbenchmark – Performance tests and benchmarks for evaluating Aspose.HTML for Java under different workloads.
  • Aspose.HTML-for-Java.WebService-on-Docker – A ready-to-use Dockerized web service that exposes Aspose.HTML functionality via REST API.
  • docs – Documentation files that help developers install, configure, and effectively use Aspose.HTML for Java.

Requirements

  • J2SE 1.6 or above
  • Maven or Gradle
  • Aspose.HTML for Java (you can download the latest version at: https://releases.aspose.com/html/java/)

Quick Start with Aspose.HTML for Java

Install Aspose.HTML for Java

Gradle. – Define Aspose.HTML for Java API dependency in your build.gradle script:

compile(group: 'com.aspose', name: 'aspose-html', version: '25.12', classifier: 'jdk16')

Maven:

<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-html</artifactId>
    <version>25.12</version>
    <classifier>jdk17</classifier>
</dependency>

Convert HTML to PDF with one line of Java code

import com.aspose.html.converters.Converter;
import com.aspose.html.saving.PdfSaveOptions;

// Invoke the convertHTML() method to convert the HTML to PDF
Converter.convertHTML("<h1>Convert HTML to PDF!</h1>", ".", new PdfSaveOptions(), "convert-with-single-line.pdf");

Download web page in Java

Extract and save a wab page with default save options in Java

import com.aspose.html.HTMLDocument;

// Initialize an HTML document from a URL
final HTMLDocument document = new HTMLDocument("https://docs.aspose.com/html/net/message-handlers/");
// Prepare a path to save the downloaded file
String savePath = "root/result.html";

// Save the HTML document to the specified file
document.save(savePath);

See all examples in Aspose.HTML-for-Java.Example

Contributing

Contributions are welcome! Feel free to submit PRs with new examples, fixes, or enhancements.

Product Page | Docs | Release Notes | Download | Demos | API Reference | Blog | Free Support | Temporary License

About

Aspose.HTML for Java examples

products.aspose.com/html/java

Topics

htmlhtml-generationjavamhtmlpdf-generation

Resources

Readme
MIT license
Activity
Custom properties

Stars

12 stars

Watchers

4 watching

Forks

12 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.