Hi,

Can sobmbody advise me please why by fop.getDefaultHandler())  I get error: The method getDefaultHandler() is undefined for the type Fop.

 

Thanks for help!

Regards,

Rafal

private

 

static void createReceiptPDF() throws IOException, TransformerFactoryConfigurationError, FileNotFoundException, TransformerConfigurationException, TransformerException, FOPException {

System.

 

out.println("createReceiptPDF() is invoked");

OutputStream out;

Document doc;

String employeeNr;

TransformerFactory fact = TransformerFactory.newInstance();

 

// Creating FO ( XSL-transformering uten FOP)

 

ByteArrayOutputStream tmpUt =

newByteArrayOutputStream();

Result result =

newStreamResult(tmpUt);

tmpUt.close();

 

 

 

 

// Using FOP to convert temporary file to PDF

 

 

 

byte

[] fo = tmpUt.toByteArray();

InputStream bais =

new ByteArrayInputStream(fo);

FopFactory fopFactory = FopFactory.newInstance();

Fop fop = fopFactory.newFop(MimeConstants.

MIME_PDF,out);

 

Transformer xformer = fact.newTransformer();

 

Logger foLogger = Logger.getLogger(

"org.apache.fop");

foLogger.setLevel(Level.

SEVERE);

 

 

 

// BufferedInputStream tmpIn = new BufferedInputStream(new FileInputStream(f));

 

Source src ="">

new

StreamSource(bais);

Result res =

new SAXResult(fop.getDefaultHandler());

//The method getDefaultHandler() is undefined for the type Fop

xformer.transform(src, result);

 

 


--
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en

Reply via email to