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 - x28/inscriptis-java: inscriptis - HTML to text conversion library for Java

This repository was archived by the owner on Jul 3, 2025. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.mvn/wrapper
.mvn/wrapper
 
 
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
mvnw
mvnw
 
 
mvnw.cmd
mvnw.cmd
 
 
pom.xml
pom.xml
 
 

Repository files navigation

Maven Build Maven Central javadoc

inscriptis - HTML to text conversion library for Java

A Java-based HTML to text conversion library with support for nested tables and a subset of CSS. Please take a look at the Rendering document for a demonstration of Inscriptis conversion quality.

This is a Java port of inscriptis for Python.

Getting Started

Here is a quick teaser of an application using inscriptis for Java:

package example;

import org.jsoup.Jsoup;
import org.jsoup.helper.W3CDom;
import org.w3c.dom.Document;

import ch.x28.inscriptis.Inscriptis;

public class Example {

	public static void main(String[] args) {

		String htmlContent = "<p style=\"margin-top:0px\">Hello World!</p>";

		// use jsoup to parse HTML and convert it to W3C Document (https://jsoup.org)
		Document document = W3CDom.convert(Jsoup.parse(htmlContent));

		Inscriptis inscriptis = new Inscriptis(document);
		String text = inscriptis.getText();

		System.out.println(text); // Hello World!
	}
}

Maven configuration

Add the Maven dependency:

<dependency>
  <groupId>ch.x28.inscriptis</groupId>
  <artifactId>inscriptis</artifactId>
  <version>1.0</version>
</dependency>

HTML parser

inscriptis requires a W3C document, so it's up to you which parser you choose. Here is a list of parsers that support a W3C document result.

jsoup

https://jsoup.org/

nu-validator HTML Parser

https://mvnrepository.com/artifact/nu.validator/htmlparser

License

inscriptis for Java is an Open Source software released under the Apache License, Version 2.0

About

inscriptis - HTML to text conversion library for Java

Topics

converterhtml2textjavalibrary

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

13 stars

Watchers

3 watching

Forks

3 forks
Report repository

Releases

Packages

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.