//Setup fonts
IFUtil.setupFonts(targetHandler);
targetHandler.setResult(new StreamResult(pdffile));
IFParser parser = new IFParser();
Source src = new StreamSource(iffile);
Source xslt = new StreamSource(stampSheet);
//Setup Transformer for XSLT processing
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer(xslt);
//Send XSLT result to AreaTreeParser
SAXResult res = new SAXResult(parser.getContentHandler(targetHandler, userAgent));
//Start XSLT transformation and area tree parsing
transformer.transform(src, res);
} finally {
out.close();