<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <title>Flying Saucer Project: <span class="caps">FAQ</span></title>
  <link href="/base.css" rel="stylesheet" type="text/css" />
</head>
<body>

<div id="fs">

<div id="menu">

<ul>
  <li>Downloads
    <ul>
      <li><a href="http://pigeonholdings.com/projects/flyingsaucer/R8/downloads/flyingsaucer-R8.zip">Release 8 Binaries</a></li>
      <li><a href="http://pigeonholdings.com/projects/flyingsaucer/R8/downloads/flyingsaucer-R8-src.zip">Release 8 All Files</a></li>
    </ul>
  </li>
  <li>About Flying Saucer
    <ul>
      <li><a href="/index.html">Project Home</a></li>
      <li><a href="/news.html">News</a></li>
      <li><a href="/feature-list.html">Feature List</a></li>
      <li><a href="/faq.html">The <span class="caps">FAQ</span></a></li>
      <li><a href="/screenshots.html">Screenshots</a></li>
      <li><a href="/demos.html">Demos</a></li>
      <li><a href="http://pigeonholdings.com/projects/flyingsaucer/R8/doc/guide/users-guide-R8.html">User's Guide R8 &#8211; <span class="caps">HTML</span></a></li>
      <li><a href="http://pigeonholdings.com/projects/flyingsaucer/R8/doc/guide/users-guide-R8.pdf">User's Guide R8 &#8211; <span class="caps">PDF</span></a></li>
      <li><a href="http://pigeonholdings.com/projects/flyingsaucer/R8/javadoc/user/index.html">Javadoc &#8211; Basic</a></li>
      <li><a href="http://pigeonholdings.com/projects/flyingsaucer/R8/javadoc/full/index.html">Javadoc &#8211; Full</a></li>
      <li><a href="/references.html">References</a></li>
      <li><a href="http://www.gnu.org/copyleft/lesser.html" title="LGPL">License</a></li>
    </ul>
  </li>
  <li>Contribute
    <ul>
      <li><a href="https://xhtmlrenderer.dev.java.net/servlets/ProjectMailingListList">Mail: User's List</a></li>
      <li><a href="https://xhtmlrenderer.dev.java.net/servlets/ProjectMailingListList">Mail: Dev List</a></li>
    </ul>
  </li>
</ul>


</div>

<h1>Flying Saucer Project: <span class="caps">FAQ</span></h1>

<p>This is our list of frequently-asked questions. For a more comprehensive guide, see our <a href="users-guide-r7rc1#.pdf">User's Guide</a>. Please contact us on our <a href="https://xhtmlrenderer.dev.java.net/servlets/ProjectMailingListList">mailing list</a> if you have more questions.</p>

<h2 class="fs_heading" style="clear:none;">General Questions</h2>

<ol class="toc">
  <li><a href="#xil_1">What is Flying Saucer?</a></li>
  <li><a href="#xil_2">Wait a second! <span class="caps">XML</span>, <span class="caps">XHTML</span>, get your story straight!</a></li>
  <li><a href="#xil_3">Does Flying Saucer support legacy <span class="caps">HTML</span>?</a></li>
  <li><a href="#xil_4">Can I use Flying Saucer to browse websites?</a></li>
  <li><a href="#xil_5">Is Flying Saucer a web browser?</a></li>
  <li><a href="#xil_6">What kind of applications can I use Flying Saucer for?</a></li>
  <li><a href="#xil_7">What <span class="caps">XHTML</span>/CSS features does Flying Saucer currently support?</a></li>
  <li><a href="#xil_8">What <span class="caps">XHTML</span>/CSS features is Flying Saucer missing?</a></li>
  <li><a href="#acid2">So do you pass the Acid(2) test?</a></li>
</ol>


<h3 class="fs_heading" id="xil_1" style="clear:none;">What is Flying Saucer?</h3>

<p>Flying Saucer is an <span class="caps">XHTML</span> renderer written in Java. It's 100% Java, not a native wrapper, and it only handles well-formed <span class="caps">XHTML</span> + <span class="caps">CSS</span>. It is intended for embedding web-based user interfaces into Java applications (ex. web photo album generator, help viewer, iTunes Music Store clone). It cannot be used as a general purpose web browser since it does not support the malformed legacy <span class="caps">HTML</span> found on the web, though recent work on compatibility libraries may be enough to do what you need. You may be able to work with legacy <span class="caps">HTML</span> (e.g. <span class="caps">HTML</span> that is not well-formed <span class="caps">XML</span>) by using a pre-processor that cleans it up; there are several of these, including JTidy and TagSoup. See our <a href="users-guide-r7rc1#.pdf">User's Guide</a> for details.</p>

<h3 class="fs_heading" id="xil_2" style="clear:none;">Wait a second! <span class="caps">XML</span>, <span class="caps">XHTML</span>, get your story straight!</h3>

<p>Flying Saucer takes well-formed <span class="caps">XML</span> (or a <span class="caps">DOM</span> Document) as input, matches it with <span class="caps">CSS</span> (linked, inline, attributed) and renders it. That <span class="caps">XML</span> could, for example, be <span class="caps">XHTML</span> (strict). We figure most of you are interested in rendering some form of <span class="caps">XHTML</span>, so in these docs we use "XHTML" as short for "well-formed <span class="caps">XML</span>, for example, <span class="caps">XHTML</span> (strict)".</p>

<p>You can render any <span class="caps">XML</span>, in fact, as long as you have <span class="caps">CSS</span> for it. For <span class="caps">XHTML</span>, we have out-of-the-box default <span class="caps">CSS</span> styling; for any other <span class="caps">XML</span>, you'll need to bring your own.</p>

<h3 class="fs_heading" id="xil_3" style="clear:none;">Does Flying Saucer support legacy <span class="caps">HTML</span>?</h3>

<h3 class="fs_heading" id="xil_4" style="clear:none;">Can I use Flying Saucer to browse websites?</h3>

<p>Flying Saucer is not an <span class="caps">HTML</span> component. It is a rendering component for <span class="caps">XHTML</span> content, but it cannot handle the malformed <span class="caps">HTML</span> 4.0 of general webpages, and it has no support for purely stylistic markup like <span class="caps">FONT</span> and <span class="caps">CENTER</span>. You have to use valid <span class="caps">XHTML</span> and <span class="caps">CSS</span>. For most embedded uses this is fine since the application author usually has control over the documents to be loaded. If you really need full IE/Mozilla/Safari-like fidelity for general purpose webpages you should look into a webbrowser wrapper like <a href="http://jdic.dev.java.net">JDIC's Browser component</a>, or a commercial component like <a href="http://www.webrenderer.com">WebRenderer</a>. Sun's Swing team has said they are working on a Java wrapper for WebKit called JWebPane, but there is no release schedule announced so far.</p>

<h3 class="fs_heading" id="xil_5" style="clear:none;">Is Flying Saucer a web browser?</h3>

<p>The core renderer just handles <span class="caps">XHTML</span> and <span class="caps">CSS</span>. It doesn't know anything about form submission, managing cookies, or tracki ng the browsing history. It just renders <span class="caps">XHTML</span>/CSS to the screen. However, Flying Saucer does include a (very simple) Browser application which shows how you might develop these features yourself. You can use this as a good starting point for your own applications.</p>

<h3 class="fs_heading" id="xil_6" style="clear:none;">What kind of applications can I use Flying Saucer for?</h3>

<p>Flying Saucer can be used for any Java application that requires some sort of styled content, to generate high-quality <span class="caps">PDF</span> output based on <span class="caps">XHTML</span> and <span class="caps">CSS</span> documents, or to layout and render images based on <span class="caps">XHTML</span> and <span class="caps">CSS</span>.</p>

<p>An application using Flying Saucer can be as simple as a chat program or as complicated as a complete ebook reader with dynamic stylesheets. Flying Saucer is very forward- thinking and is designed to be a part of the next generation of applications that combine rich desktop clients with web content. Some examples of application types are:</p>

<ul>
  <li>chat programs</li>
  <li>online music stores</li>
  <li>a Gutenberg eBook reader</li>
  <li>a distributed dictionary application</li>
  <li>Sherlock style map and movie search</li>
  <li>Konfabulator and Dashboard components</li>
  <li>an <span class="caps">RSS</span> reader</li>
  <li>a Friendster client</li>
  <li>an eBay client</li>
  <li>a splash screen</li>
  <li>an about box</li>
  <li>a helpfile viewer</li>
  <li>a javadoc viewer</li>
  <li>report generation and viewing</li>
  <li>a stock ticker / weather reporter</li>
</ul>


<p>Flying Saucer has become a favorite recently for people who need to render clean <span class="caps">XHTML</span> to <span class="caps">PDF</span>; we support <span class="caps">PDF</span> output via the iText library.</p>

<h3 class="fs_heading" id="xil_7" style="clear:none;">What <span class="caps">XHTML</span>/CSS features does Flying Saucer currently support?</h3>

<p>Flying Saucer supports all of <span class="caps">CSS</span> 2.1 with a few exceptions.  Consult the <a href="https://xhtmlrenderer.dev.java.net/servlets/ProjectIssues">issue tracker</a> for more information on what is not supported (in particular, the issues with a summary of "Support ...") or ask on the <a href="https://xhtmlrenderer.dev.java.net/servlets/ProjectMailingListList">mailing list</a>.</p>

<p>If you do encounter a compliance bug or other unexpected behavior, please open a bug or post to the <a href="https://xhtmlrenderer.dev.java.net/servlets/ProjectMailingListList">mailing list</a>. Our goal is 100% compliance with the <span class="caps">CSS</span> 2.1 specification.</p>

<h3 class="fs_heading" id="xil_8" style="clear:none;">What <span class="caps">XHTML</span>/CSS features is Flying Saucer missing?</h3>

<p>Check the <a href="https://xhtmlrenderer.dev.java.net/servlets/ProjectIssues">issue tracker</a> for a list or ask on the <a href="https://xhtmlrenderer.dev.java.net/servlets/ProjectMailingListList">mailing list</a> if you aren't sure.</p>

<p>Among other things there is  no support for things outside the scope of <span class="caps">XHTML</span>/CSS such as Javascript, Flash, or legacy <span class="caps">HTML</span> (though there is interest in all of those).</p>

<h3 class="fs_heading" id="acid2" style="clear:none;">So do you pass the Acid(2) test?</h3>

<p>Our core developer in the R7 development cycle, Pete Brant, reported that it was possible to render Acid2 pretty well, with some caveats. Quoting from him in the developer's email list:</p>

<p><em>begin quote</em></p>

<p>"Save for the changes below, test_as_xml.xml is an unmodified version of <a href="http://hixie.ch/tests/evil/acid/002-no-data/">http://hixie.ch/tests/evil/acid/002-no-data/</a>. All in all things are looking good!</p>

<p>Changes to original test:</p>

<ol>
  <li>Replace <span class="caps">DOCTYPE</span> with one we recognize to pick up entity references (in particular &nbsp;)</li>
  <li>Wrap <code>&lt;style&gt;</code> tag in <span class="caps">CDATA</span></li>
  <li>Close open tags as appropriate (in particular, <code>&lt;p&gt;</code> and table related tags in row 1 [as referenced from the test guide], <code>&lt;link&gt;</code> in header, and bottom <code>&lt;img&gt;</code> (after row 14 in guide)</li>
  <li>Replace <code>&lt;object data="data007"&gt;ERROR&lt;/object&gt;</code> with <code>&lt;img src="data007"&gt;ERROR&lt;/img&gt;</code> (since we don't support <span class="caps">HTML</span>'s <code>&lt;object&gt;</code> )</li>
  <li>Change <span class="caps">CSS</span> selector on line 55 from "#eyes-a object object object" to "#eyes-a object object img" to compensate for (4)</li>
  <li>Bottom <code>&lt;img&gt;</code> uses a data <span class="caps">URL</span> even in the non-data <span class="caps">URL</span> version (I assume it was just missed).  Save data <span class="caps">URL</span> contents to disk (as data008) and update src attribute</li>
</ol>


<p>Of course, these changes mean that we cannot claim Acid2 compliance, but nothing there changes the nature of the test (at least as far as a <span class="caps">CSS</span> torture test goes).</p>

<p>Besides those changes above, there are still the following compliance problems:</p>

<ol>
  <li>The transparent pixels in the eyes row background(s) are painted as black.  Weird considering that the alpha channel in the eyes graphic itself is apparently picked up fine.</li>
  <li>Hover doesn't work on generated content (hence no blue nose on mouseover)</li>
  <li>There shouldn't be a scroll bar on the page by virtue of @html { overflow: hidden; }@"</li>
</ol>


<p><em>end quote</em></p>

<p>The resulting image is available on our project home page, as an Easter egg. See if you can find the little bandit.</p>

<h2 class="fs_heading" style="clear:none;">Usage Questions</h2>

<ol class="toc">
  <li><a href="#xil_9">How do I make my program follow hyperlinks?</a></li>
  <li><a href="#xil_10">How do I get access to the Swing components that make up my form fields?</a></li>
  <li><a href="#xil_11">I have <span class="caps">XML</span> or <span class="caps">XHTML</span> stored in a Java String, not a file&#8212;how do I load this into an XHTMLPanel?</a></li>
  <li><a href="#xil_12">How do I force Anti-aliasing?</a></li>
  <li><a href="#xil_13">When I use the <code>setDocument(dom, url)</code> constructor, what should the url parameter point to?</a></li>
  <li><a href="#xil_14">How do i get the starting index of selected text?</a></li>
  <li><a href="#xil_15">How can I "watermark" <span class="caps">PDF</span>'s created through FS?</a></li>
  <li><a href="#xil_16">I've created a replacedelementfactory for a custom <span class="caps">XML</span> element (e.g. MathML), but it's not getting replaced within the document.</a></li>
  <li><a href="#xil_17">My <span class="caps">PDF</span> isn't picking up my <span class="caps">CSS</span>!</a></li>
  <li><a href="#xil_18">How can I print multiple pages on to one <span class="caps">PDF</span>, if they come from multiple documents?</a></li>
  <li><a href="#xil_19">Can I use Flying Saucer in an <span class="caps">SWT</span> application?</a></li>
  <li><a href="#xil_20">My header is not showing up correctly in my <span class="caps">PDF</span>.</a></li>
  <li><a href="#xil_21">How do I set a custom UserAgentCallback when generating <span class="caps">PDF</span>?</a></li>
  <li><a href="#xil_22">How do I figure out the size of a document I'm rendering? Can I get this from the renderer? How about preferred size of XHTMLPanel? Why isn't my panel properly sized on screen?</a></li>
</ol>


<h3 class="fs_heading" id="xil_9" style="clear:none;">How do I make my program follow hyperlinks?</h3>

<p>You need a mouse listener that detects link clicks and does the <span class="caps">HTTP</span> request. The <code>BasicPanel</code> supports tracking mouse events and delegating them to <code>FSMouseListener</code> instances. You can use the <code>org.xhtmlrenderer.swing.LinkListener</code> class, which implements <code>FSMouseListener</code>, for basic hyperlink navigation support.</p>

<h3 class="fs_heading" id="xil_10" style="clear:none;">How do I get access to the Swing components that make up my form fields?</h3>

<p>Take a look at the <code>org.xhtmlrenderer.simple.extend.XhtmlForm</code> class. Form elements are "replaced" at runtime by the <code>org.xhtmlrenderer.swing.SwingReplacedElementFactory</code> if you're using the <code>XHTMLPanel</code> class for rendering. The factory actually creates a new <code>XhtmlForm</code> class which creates and tracks the components. To receive a callback when the user submits a form, add a <code>FormSubmissionListener</code> instance to your <code>BasicPanel</code>.</p>

<h3 class="fs_heading" id="xil_11" style="clear:none;">I have <span class="caps">XML</span> or <span class="caps">XHTML</span> stored in a Java String, not a file&#8212;how do I load this into an XHTMLPanel?</h3>

<p>It's been tricky for us to come up with a decent set of method calls to cover initilizing the panel without creating tons of little methods.</p>

<p>In Java APIs, there is some confusion on usage between a String that represents an address (like a <span class="caps">URI</span> or a file path) and strings that represent content. Our <span class="caps">API</span> tends to expect that Strings will represent addresses.</p>

<p>You can use <code>panel.setDocumentFromString()</code> to render a document from a string containing <span class="caps">XHTML</span> content. The String will be passed to the standard <span class="caps">XML</span> parser and treated as a regular document.</p>

<p>It's important to remember that FS expects well-formed <span class="caps">XML</span> documents, and we don't have an extremely friendly relationship with the <span class="caps">XML</span> parsers; it's always a good idea to test that your document can be loaded outside of FS, without error, using Java <span class="caps">XML</span> APIs, before loading them in FS. This is especially true if you are generating <span class="caps">XHTML</span> on-the-fly.</p>

<h3 class="fs_heading" id="xil_12" style="clear:none;">How do I force Anti-aliasing?</h3>

<p>Either<br />
* Set the appropriate configuration properties: <code>xr.text.aa-fontsize-threshhold</code><br />
* Get the <code>Java2DTextRenderer</code> reference from the XHTMLPanel's <code>SharedContext</code> property, then call <code>setSmoothingThreshold()</code></p>

<p>The threshold is the font size at which AA should kick in, for text; font sizes below that size will <strong>not</strong> be drawn with AA. A threshold of -1 turns AA off completely.</p>

<p>Note that on some platforms and JREs, AA can slow things down considerably. It appears to be much better with more recent Sun JREs, such as Java 6.</p>

<h3 class="fs_heading" id="xil_13" style="clear:none;">When I use the <code>setDocument(dom, url)</code> constructor, what should the url parameter point to?</h3>

<p>The url is the "base", which for a normal <span class="caps">URL</span> would be the parent location&#8212;the parent directory, or the location where the document you are rendering is located.</p>

<p>If your document has absolute URIs for <span class="caps">CSS</span> and images, or it has no external references at all, then the base url can be null.</p>

<p>If your document has any relative URIs for <span class="caps">CSS</span> or images, then the base <span class="caps">URL</span> should <strong>not</strong> be null, but rather should point to the directory or address where the current document is located.</p>

<h3 class="fs_heading" id="xil_14" style="clear:none;">How do i get the starting index of selected text?</h3>

<p>_I am using the selection / highlighting capabilities in Flying Saucer. Hightlighting works fine, but I need to have the index of the selection. Is this possible?</p>

<p>That's not possible out of the box.  The <span class="caps">DOM</span> interface doesn't provide position information. An option is to walk through the nodes of the document to the left of the start of the selected range and then adding all the text content lengths.</p>

<h3 class="fs_heading" id="xil_15" style="clear:none;">How can I "watermark" <span class="caps">PDF</span>'s created through FS?</h3>

<p>Either use the background property inside of <code>@page</code> or <code>PdfStamper</code> after the <span class="caps">PDF</span> is already created. <code>PdfStamper</code> is part of the iText <span class="caps">API</span>.</p>

<h3 class="fs_heading" id="xil_16" style="clear:none;">I've created a replacedelementfactory for a custom <span class="caps">XML</span> element (e.g. MathML), but it's not getting replaced within the document.</h3>

<p>Make sure the element has it's display style as inline-block or block. Only block-level elements can be replaced.</p>

<h3 class="fs_heading" id="xil_17" style="clear:none;">My <span class="caps">PDF</span> isn't picking up my <span class="caps">CSS</span>!</h3>

<p><span class="caps">PDF</span> is treated as "print" media; see the <a href="http://www.w3.org/TR/CSS21/media.html">CSS 2.1 specification section on media types</a>. Make sure you have specified the media type for your <span class="caps">CSS</span> when you link or embed it; use type "print" or "all".</p>

<h3 class="fs_heading" id="xil_18" style="clear:none;">How can I print multiple pages on to one <span class="caps">PDF</span>, if they come from multiple documents?</h3>

<p>For the first document in the set (e.g. starting with the first page in the <span class="caps">PDF</span> you want to render) take an ITextRenderer and call <code>setDocument()</code>, <code>layout()</code> and <code>createPDF()</code>; for each subsequent document, use the same renderer and call <code>setDocument()</code>, <code>layout()</code>, and <code>writeNextDocument()</code>. Call <code>finishPDF()</code> to complete the process. A sample follows below; a cleaned-up example, <code>PDFRenderToMultiplePages</code>, is in our demos/samples directory in our source distribution.</p>

<pre><code>String root = "J:/Temp/fs";

String[] inputs = new String[] { "input1.html", "input2.html",
"input3.html" };
String output = "output.pdf";

OutputStream os = null;
try
{
   os = new FileOutputStream(new File(root, output));

   ITextRenderer renderer = new ITextRenderer();

   renderer.setDocument(new File(root, inputs[0]));
   renderer.layout();

   renderer.createPDF(os, false);

   for (int i = 1; i &lt; inputs.length; i++)
   {
       renderer.setDocument(new File(root, inputs[i]));
       renderer.layout();
       renderer.writeNextDocument();
   }

   renderer.finishPDF();

   os.close();
   os = null;
}
finally
{
   if (os != null)
   {
       try
       {
           os.close();
       }
       catch (IOException e)
       {
           // ignore
       }
   }
}
</code></pre>

<h3 class="fs_heading" id="xil_19" style="clear:none;">Can I use Flying Saucer in an <span class="caps">SWT</span> application?</h3>

<p>If you're trying to output to an <span class="caps">SWT</span> canvas&#8212;there is an early mockup by Vianney le Cl&eacute;ment which we plan to merge in the R8 release. See the mailing list thread starting with:<br />
https://xhtmlrenderer.dev.java.net/servlets/ReadMsg?listName=dev&msgNo=3452</p>

<p>There are patches attached to that mail thread which provide initial support for <span class="caps">SWT</span>; some things are still missing, but it's a good start.</p>

<h3 class="fs_heading" id="xil_20" style="clear:none;">My header is not showing up correctly in my <span class="caps">PDF</span>.</h3>

<p>The values of <code>-fs-flow-top/right/bottom/left</code> and <code>-fs-move-to-flow</code> must<br />
be strings and not keywords (e.g. <code>-fs-flow-top: 'header'</code> instead of<br />
<code>-fs-flow-top: header</code> ).</p>

<p>The new <span class="caps">CSS</span> parser validates this (and will give you a warning message if you have logging turned on).</p>

<h3 class="fs_heading" id="xil_21" style="clear: none;">How do I set a custom UserAgentCallback when generating <span class="caps">PDF</span>?</h3>

<pre><code>ITextRenderer renderer = new ITextRenderer();

ITextUserAgent callback = new ITextUserAgent(renderer.getOutputDevice());
callback.setSharedContext(renderer.getSharedContext());
renderer.getSharedContext().setUserAgentCallback(callback);

renderer.setDocument(url);
renderer.layout();
renderer.createPDF(os);
</code></pre>

<h3 class="fs_heading" id="xil_22" style="clear: none;">How do I figure out the size of a document I'm rendering? Can I get this from the renderer? How about preferred size of XHTMLPanel? Why isn't my panel properly sized on screen?</h3>

<p>The rules are that the document size is calculated after a layout takes place; for rendering to a Swing panel, this can only happen if the container for the panel (e.g. the window) is displayable. See <a href="https://xhtmlrenderer.dev.java.net/servlets/ReadMsg?list=users&msgNo=777">this email thread in our mailing list</a> for a discussion. In our demos/samples directory in the source distribution, the <code>PanelResizeToPreferredSize</code> and <code>JPanelSizeToDocument</code> show how this is done. Basically (quoting from the mail thread):</p>

<p>"So basically you want to:</p>

<ol>
  <li>create the frame and add components to it</li>
  <li>call <code>f.pack()</code> to make them displayable</li>
  <li>layout documents in <code>XHTMLPanel</code> instances using <code>doDocumentLayout(graphics)</code></li>
  <li>call <code>f.pack()</code> again now that the preferred size of the <code>XHTMLPanel</code> instances has been calculated"</li>
</ol>


<p>If you are relying on a layout manager that itself relies on its components' preferred sizes (like FlowLayout) you need to make sure to follow the rules above in order for the layout manager to pick up the size of the panel <strong>after</strong> it has been layed out. The second call to <code>pack()</code> after <code>doDocumentLayout()</code> takes care of doing this. See <code>PanelResizeToPreferredSize</code> for an example using <code>FlowLayout</code>.</p>

<h2 class="fs_heading" style="clear:none;">Developer's <span class="caps">FAQ</span></h2>

<ol class="toc">
  <li><a href="#xil_23">How do I set up my <span class="caps">CLASSPATH</span>?</a></li>
  <li><a href="#xil_24">How do I build XR without Ant?</a></li>
  <li><a href="#xil_25">How do I build XR from within my <span class="caps">IDE</span>?</a></li>
</ol>


<h3 class="fs_heading" id="xil_23" style="clear:none;">How do I set up my <span class="caps">CLASSPATH</span>?</h3>

<p>You only need the</p>

<ul>
  <li><code>core-renderer.jar</code> (required)</li>
  <li><code>${itext.jar}</code></li>
</ul>


<p>The first two are required; iText is needed for <span class="caps">PDF</span> rendering.</p>

<p>In earlier releases, you needed to include a <span class="caps">CSS</span> parser in the <span class="caps">CLASSPATH</span>. This is no longer necessary, as Flying Saucer now includes a fast, compliant <span class="caps">CSS</span> parser.</p>

<p>That is all you need for your own programs. You also need an <span class="caps">XML</span> parser to be in your classpath, but this already included in recent versions of the <span class="caps">JRE</span>.</p>

<p>To run the browser or use any of it's support classes you will need the <code>browser.jar</code> file.</p>

<h3 class="fs_heading" id="xil_24" style="clear:none;">How do I build XR without Ant?</h3>

<h3 class="fs_heading" id="xil_25" style="clear:none;">How do I build XR from within my <span class="caps">IDE</span>?</h3>

<p>Our Ant <code>build.xml</code> file includes all <span class="caps">JAR</span> files in the <code>/lib</code> directory, plus the <code>/resources</code> directory tree in the classpath. The compile target also copies <span class="caps">CSS</span> and properties resources from <code>/src/css</code> and <code>src/conf</code> to <code>/build/resources</code>. If running from an <span class="caps">IDE</span>, you will need to synchronize this yourself.</p>

</div>

</body>
</html>