Hi there,
I am trying to include and embad a font into a FOP generated PDF file.
I have sucessfully done this via the fop configuration file but am hoping it is
also possible to do this programatically.
Do you know if this is possible?
My Java implementation is as follows:
FopFactory fopFactory = FopFactory.newInstance();
FOUserAgent userAgent = fopFactory.newFOUserAgent();
File file = new File("C:/work/36/wa/bil/misc/fop/config.xml");
fopFactory.setUserConfig(file);
// Setup output
out = new java.io.FileOutputStream(fopOutputDir + fileRoot +
".pdf");
out = new java.io.BufferedOutputStream(out);
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent, out);
//Setup Transformer
Source xsltSrc = new StreamSource(fopDirectory + xslName);
TransformerFactory transformerFactory =
TransformerFactory.newInstance();
Transformer transformer =
transformerFactory.newTransformer(xsltSrc);
Source src = new StreamSource(new StringReader(xmlString));
//Make sure the XSL transformation's result is piped through to FOP
Result res = new SAXResult(fop.getDefaultHandler());
//Start the transformation and rendering process
transformer.transform(src, res);
Cheers,
Richard
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]