MaikJaek / flying-saucer

Automatically exported from code.google.com/p/flying-saucer
0 stars 0 forks source link

pdf rendering from html on window/linux: images not loaded in linux #175

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. render pdf from xhtml  (see attached samples/results)

What is the expected output? What do you see instead?
pdf with images

What version of the product are you using? On what operating system?
R8 (win7 - working / ubuntu 11.04 - not working)

Please provide any additional information below.

rendered using simplest example possible:

    OutputStream os = null;
        ITextRenderer renderer = new ITextRenderer();

        try {
            for(String templateFile : Arrays.asList(velocityTemplates)){
                os = new FileOutputStream(templateFile.concat(".pdf") );
                String htmlString = FileUtils.readFileToString(new File(templateFile)); // generateHtml(templateFile);
                System.out.println(htmlString);
                renderer.setDocumentFromString(htmlString);
                renderer.layout();
                renderer.createPDF(os);
                os.close();
                System.out.println("generated:" + templateFile.concat(".pdf"));
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            System.out.println("done");
        }

Original issue reported on code.google.com by turch...@gmail.com on 21 Sep 2011 at 9:49

Attachments:

GoogleCodeExporter commented 8 years ago
appendix: we are referencing the images using http://.../. the URL resolution 
is quite simple (no ".." or other issues that i read in the issue tracker) and 
the URLs work in xhtml and the page rendered correctly in windows. in linux the 
images not present, though everything else is the same (same JAR, same 
html/URLs, etc).

Original comment by turch...@gmail.com on 21 Sep 2011 at 10:01

GoogleCodeExporter commented 8 years ago
this issue can be ignored. it turned out to be a problem with the routing via 
iptables for the requests from port 80 to 8080 on the localhost

Original comment by turch...@gmail.com on 26 Oct 2011 at 2:14