xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Rost <marcelr...@gmx.net>
Subject Problem using FOP 1.0 with Java 1.4.2.08
Date Thu, 19 Apr 2012 17:20:02 GMT

Hello, 

we have a problem with FOP 1.0 and Java 1.4.2.08.


Application setup
Java 1.4.2.08 (no possibility to upgrade)
FOP 1.0


Problem:
We used FOP-0.20.5 together with Java 1.4.2.08 and upgraded the FOP version
to 1.0.
Before the upgrade we were able to create digital prints as text using the
AWTRenderer. If we send the output to a driver like PDFCreator the output
was a PDF with embedded fonts.

With the new FOP version I am using the PageableRenderer. If you send such a
file to a driver like PDFCreator, the text within the PDF is not selectable
anymore as it is rendered as vector graphics.
Creating PDF files with the PDFRenderer works fine. The font is embedded
correctly.

As you can see in the examples the text is rendered as vector graphics
instead using the fonts.
This causes that afterwards we cannot access the printed text from the
printout again. (which we needed for further processing)

We tried out to run our application on Java6 and Java7 and there we got the
result like with FOP-0.20.5.

What can be excluded are corrupt stylesheets as we encountered the same
problem using the helloworld from the "Quick Start Guide".

The way we trigger the printing for FOP 1.0:



-----------------

        //Set up PrinterJob instance
        PrinterJob printerJob = PrinterJob.getPrinterJob();
        printerJob.setJobName("FOP Printing Example");

        try {
            //Set up a custom user agent so we can supply our own renderer
instance
            FOUserAgent userAgent = fopFactory.newFOUserAgent();
            PageableRenderer pageableRenderer = new PageableRenderer();
            pageableRenderer.setUserAgent(userAgent);
            userAgent.setRendererOverride(pageableRenderer);
            
            // Construct FOP with desired output format
            Fop fop = fopFactory.newFop(MimeConstants.MIME_FOP_PRINT,
userAgent);

            // Setup JAXP using identity transformer
            TransformerFactory factory = TransformerFactory.newInstance();
            Transformer transformer = factory.newTransformer(); // identity
transformer

            // Setup input stream
            Source src = new StreamSource(fo);

            // Resulting SAX events (the generated FO) must be piped through
to FOP
            Result res = new SAXResult(fop.getDefaultHandler());

            // Start XSLT transformation and FOP processing
            transformer.transform(src, res);
            
           
printerJob.setPageable((Pageable)userAgent.getRendererOverride());
            if (printerJob.printDialog()) {
            	printerJob.print();
            }
        } catch (Exception e) {
            e.printStackTrace(System.err);
            System.exit(-1);
        }

-----------------


Are there any problems or workarounds known with the constellation of FOP
1.0 and Java 1.4.2.08?

Example PDF files from different JDKs:
Java 1.4.2.08
http://old.nabble.com/file/p33715777/FOP%2BPrinting%2BExample_java_1.4.2.pdf
FOP+Printing+Example_java_1.4.2.pdf 

Java 6
http://old.nabble.com/file/p33715777/FOP%2BPrinting%2BExample_java6.pdf
FOP+Printing+Example_java6.pdf 


Best regards, 
Marcel Rost
-- 
View this message in context: http://old.nabble.com/Problem-using-FOP-1.0-with-Java-1.4.2.08-tp33715777p33715777.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message