Hi there!
 
I have the following method in a Servlet that helps me to output pdf files:
 
 
    private ByteArrayOutputStream transform(Source xmlSrc, Source xslSrc)
            throws TransformerConfigurationException, TransformerException {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        org.apache.fop.configuration.Configuration.put("baseDir", BASE_DIR);
        Driver driver = new Driver();
        Logger logger = new Log4JLogger(log4j);
        MessageHandler.setScreenLogger(logger);
        driver.setLogger(logger);
        driver.setRenderer(Driver.RENDER_PDF);
        driver.setOutputStream(out);
        TransformerFactory transformerFactory = TransformerFactory.newInstance();
        Transformer transformer = transformerFactory.newTransformer(xslSrc);
        Result res = new SAXResult(driver.getContentHandler());
        transformer.transform(xmlSrc, res);
        return out;
    }
 
The problem is that right now I need to generate some bar codes in my pdfs and I have think to embed a ttf font in my pdfs that I can use to generate those barcodes. I have the ttf font file and the xml font metrics file but right now I don�t know what must I add to the code to be able to use this font in my pdfs... can you help me?
 
Thanks a lot!!
 
    Raul (Spain)
 

Reply via email to