Class JPanelSizeToDocument
java.lang.Object
JPanelSizeToDocument
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
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
private void
loadAndCheckArgs
(String[] args) static void
private void
messageAndExit
(String msg) private void
-
Field Details
-
fileName
-
targetWidth
private int targetWidth
-
-
Constructor Details
-
JPanelSizeToDocument
public JPanelSizeToDocument()
-
-
Method Details
-
main
-
run
-
launchGUI
private void launchGUI() -
loadAndCheckArgs
-
messageAndExit
-