Flying Saucer Documentation

repository·main·Indexed 25 days ago

https://github.com/flyingsaucerproject/flyingsaucer

A pure-Java library for rendering well-formed XML or XHTML using CSS 2.1. It enables the conversion of web-like markup into PDF, images, Swing components, and SWT output. The library provides specific artifacts for different targets, including flying-saucer-core, flying-saucer-pdf, and flying-saucer-chrome-pdf.

Tokens
347
Snippets
0
Records
4
Agent score
31%

What's inside Flying Saucer

  1. Install Flying Saucer via Maven

    main

    Flying Saucer is distributed through Maven. Choose the artifact that matches your required output format:

    • org.xhtmlrenderer:flying-saucer-core: Core library and Java2D rendering.
    • org.xhtmlrenderer:flying-saucer-pdf: PDF output using OpenPDF.
    • org.xhtmlrenderer:flying-saucer-chrome-pdf: PDF output by delegating to chrome-headless-shell (supports modern HTML5/CSS3).
    • org.xhtmlrenderer:flying-saucer-swt: SWT output.
    • org.xhtmlrenderer:flying-saucer-log4j: Logging plugin for log4j.

    Note: org.xhtmlrenderer:flying-saucer-pdf-openpdf is deprecated and has been replaced by flying-saucer-pdf.

  2. Key Entry Points for Rendering

    main

    Depending on your target output, use the following classes as entry points:

    • Swing/UI: org.xhtmlrenderer.simple.XHTMLPanel
    • PDF: org.xhtmlrenderer.pdf.PDFRenderer
    • Images: org.xhtmlrenderer.simple.ImageRenderer
    • Browser Demo: org.xhtmlrenderer.demo.browser.BrowserStartup