Search code examples
javacssflying-saucer

Flying Saucer does not render well the page (and outputs CSS)!


I searched and searched and looked at the code from Flying Saucer demos and browser. I cannot understand why this does not work.

It should display the report.html demo. This is what it displays: http://i55.tinypic.com/288v807.png

I am using Flying Saucer inside an applet. My configuration file is exactly the same as the demo browser and it's loaded correctly.

// this variable contains the xml
contentFileString = "..";

ScalableXHTMLPanel view = new ScalableXHTMLPanel();
view.setCenteredPagedView(true);
view.setBackground(Color.WHITE);

int text_width = 200;
view.setPreferredSize(new Dimension(text_width, text_width));
Document document = XMLResource.load(new StringReader(contentFileString)).getDocument();
view.setDocument(document);

// .. render the frame 
FSScrollPane scroll = new FSScrollPane(view);

JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(scroll, BorderLayout.CENTER);
frame.pack();
frame.setSize(700, 600);
frame.setVisible(true);

You could say its from loading FS from the document. I already tried loading it from an URI and it gives me the same output. It's driving me insane. Has anybody had this issue?


Solution

  • Listen to me carefully: DO NOT use the core-renderer-minimal.jar

    This was one of the most stupid errors. Just that, use the core-renderer.jar and you're good to go.