public class JPanelSizeToDocument
extends Object
This example shows how to render a document as a Swing JPanel (XHTMLPanel, a subclass) and have the
render engine figure out the document size for you; the frame containing the panel is then sized to
the document size. To run this sample from the command line, make sure you have the Flying Saucer
JARs in the classpath; arguments to the program are a URL or file path, and optionally, a target width
for the document (width defaults to 800 otherwise):
java -jar core-renderer.jar JPanelSizeToDocument myHtml.html 1024
- Author:
- Patrick Wright